I have hundreds of thousands objects on map. And select from base almost all of them (within map container rectangle on a small scale) is very bad practice. Need clustering inside DB. In a relational database is often used additional table - cluster, which is selected first. Is there some best practice for geospatial clustering inside MongoDB? Google says nothing.
UPD. Wanted like this, but in MongoDB: https://gis.stackexchange.com/questions/11567/spatial-clustering-with-postgis
MongoDB supports query operations on geospatial data.
In contrast to a single-server MongoDB database, a MongoDB cluster allows a MongoDB database to either horizontally scale across many servers with sharding, or to replicate data ensuring high availability with MongoDB replica sets, therefore enhancing the overall performance and reliability of the MongoDB cluster.
MongoDB provides the functionality to store locations under the object type geoJSON and their coordinates against the coordinate field in [longitude, latitude] form where longitude must lie between [-180, 180] and latitude must lie between [-90,90], both inclusive.
Geospatial queries are specialized types of SQL queries supported in Athena. They differ from non-spatial SQL queries in the following ways: Using the following specialized geometry data types: point , line , multiline , polygon , and multipolygon .
For hundreds of thousands of items, the built-in MongoDB geospatial indexing works pretty well depending on what you're doing.
The Mongo "Haystack Queries" may also be along the lines of what you're thinking.
You might also be interested in this discussion of Mongo's GIS capabilities compared to an RMDBS
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With