Is it possible to use mongoDB geospacial indexes with grid FS

108 views Asked by At

I have a large geojson feature collection which is over 16MB. I am hoping to insert the data into MongoDB so that I can utilize the geospatial functionality that MongoDB offers ($geoIntersects, $geoWithin, etc). Due to the large size of the file, I cannot store the data in one MongoDB document.

I have used GridFS to break the file up into several chunks within MongoDB but I am now unsure whether I can now utilize the geospatial features that I would like to.

Does anyone know if this is possible and if so whats the best way to do something like this?

1

There are 1 answers

0
D. SM On

One way you should be able to achieve what you are describing is to extract the data to be indexed into a separate collection, and add indexes on that collection.

GridFS essentially takes the data, splits it into 16 MB chunks or less and stores each chunk as a document. I don't see how the chunks would be supported by a geo index.