Mongodb geodata clustering

We have a database mongodb s> 200 thousand lines, each of which contains a point (lat, lng). We would like to create a query that sets a geographical point and radius and returns a list of clusters. Each cluster is a collection of locations located next to each other.

First question: is it possible for mongodb to automatically create and maintain these clusters for us? and if so, how can we request mongodb to return clusters (rather than actual data points) for a specific geolocation. Each returned cluster will have a position and the number of actual data points (labels with reference to geometry). Basically, we would like it to return the equivalent of the k-mean clustering algorithm.

We created the geoHaystack mongodb index, which seems to be clustered rows, but not sure how we can use it to achieve the above query:

db.locations.createIndex ({'position': "geoHaystack", type: 1}, {bucketSize: 1})

Alternatively, we could dynamically use a clustering algorithm such as https://github.com/spember/geo-cluster to create these clusters, but I assume this will be a very slow process.

Any recommendations on how best to implement such a query?

+7
mongodb geolocation geospatial
source share

No one has answered this question yet.

See related questions:

1299
How to query MongoDB with an "how"?
873
Big data workflows using pandas
825
How to remove a MongoDB database from the command line?
5
MongoDB Geospatial query areas overlapping a single point
4
Spring -data mongodb geo query
one
Geospatial Search with mongodb morphine using Java
one
MongoDB performance with geodata
0
Display geosocial user content using MongoDB
0
Calculate border from multiple geographic locations
0
Spatial clustering with ruby ​​and mongod

All Articles