Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ElasticSearch: geo point clustering

I have some rows with geo points in an ElasticSearch index. Now, I search for all rows e.g. in the radius of 5 kilometers. The result is a list with all points matching the query.

Is it possible to cluster the result in ElasticSearch to get all "hotspots"? Already found the geo centroid aggregation function of elasticsearch but that's not the thing I am searching for.

I know, it is possible to do it with libraries like Supercluster by Mapbox or something like that. But is it possible with ElasticSearch? Please see the two pictures. The second picture shows the result I want to get. Cheers!

enter image description here

enter image description here

like image 425
m_____0 Avatar asked Oct 15 '25 13:10

m_____0


1 Answers

I haven't used it but i think you need a geo hash grid aggregation. See: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html

You should be able to vary your precision and it will return geo_hash buckets with counts of docs.

like image 68
Archit Saxena Avatar answered Oct 18 '25 13:10

Archit Saxena



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!