Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geospatial clustering (MongoDB)

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

like image 741
Klimashkin Avatar asked Jan 13 '13 16:01

Klimashkin


People also ask

Does MongoDB support geospatial?

MongoDB supports query operations on geospatial data.

Can MongoDB be clustered?

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.

How does MongoDB store location?

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.

What are geospatial queries?

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 .


1 Answers

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

like image 146
mjhm Avatar answered Nov 03 '22 01:11

mjhm