# Geo\_point clustering?

**URL:** <https://discuss.elastic.co/t/geo-point-clustering/6615>\
**Category:** Elasticsearch\
**Created:** [February 7, 2012, 9:50am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615 "2012-02-07T09:50:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [February 7, 2012, 9:50am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/1 "2012-02-07T09:50:03Z")

</div>

elasticsearch supports bounding box queries and even has a distance  
facet. How difficult would it be to add a facet that clusters points,  
e.g. like [http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/examples/advanced\_example.html](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/examples/advanced_example.html)?

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 7, 2012, 11:47am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/2 "2012-02-07T11:47:19Z")

</div>

Not sure…, requires some thought and investigation on how best to implement such clustering, but once the algo is in place, it should not be difficult to add it to ES.

On Tuesday, February 7, 2012 at 11:50 AM, Eric Jain wrote:

> elasticsearch supports bounding box queries and even has a distance  
> facet. How difficult would it be to add a facet that clusters points,  
> e.g. like [http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/examples/advanced\_example.html](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/examples/advanced_example.html)?

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [February 8, 2012, 4:15am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/3 "2012-02-08T04:15:51Z")

</div>

On Tue, Feb 7, 2012 at 03:47, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Not sure…, requires some thought and investigation on how best to implement  
> such clustering, but once the algo is in place, it should not be difficult  
> to add it to ES.

Could use the algorithm from  
[http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js)?  
Here is an even simpler version: [gist:1765376 · GitHub](https://gist.github.com/1765376). The  
clustering with this method is far from optimal, but appears to be  
usable: [https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb](https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 9, 2012, 7:08am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/4 "2012-02-09T07:08:45Z")

</div>

Cool!, open an issue with the reference?

On Wednesday, February 8, 2012 at 6:15 AM, Eric Jain wrote:

> On Tue, Feb 7, 2012 at 03:47, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > Not sure…, requires some thought and investigation on how best to implement  
> > such clustering, but once the algo is in place, it should not be difficult  
> > to add it to ES.
> 
> Could use the algorithm from  
> [http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js)?  
> Here is an even simpler version: [gist:1765376 · GitHub](https://gist.github.com/1765376). The  
> clustering with this method is far from optimal, but appears to be  
> usable: [https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb](https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 9, 2012, 7:10am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/5 "2012-02-09T07:10:54Z")

</div>

Btw, we also need a method that cluster out of clusters (the reduce phase from all the shards).

On Wednesday, February 8, 2012 at 6:15 AM, Eric Jain wrote:

> On Tue, Feb 7, 2012 at 03:47, Shay Banon \<[kimchy@gmail.com](mailto:kimchy@gmail.com) ([mailto:kimchy@gmail.com](mailto:kimchy@gmail.com))\> wrote:
> 
> > Not sure…, requires some thought and investigation on how best to implement  
> > such clustering, but once the algo is in place, it should not be difficult  
> > to add it to ES.
> 
> Could use the algorithm from  
> [http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer.js)?  
> Here is an even simpler version: [gist:1765376 · GitHub](https://gist.github.com/1765376). The  
> clustering with this method is far from optimal, but appears to be  
> usable: [https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb](https://www.google.com/fusiontables/DataSource?snapid=S386109S-lb).

---

<div class="post-metadata">

**Author:** ![Eric\_Jain](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eric_jain/32/834_2.png) [@Eric\_Jain](https://discuss.elastic.co/u/Eric_Jain)\
**Post date:** [February 10, 2012, 4:03am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/6 "2012-02-10T04:03:31Z")

</div>

On Feb 8, 11:10 pm, Shay Banon [kim...@gmail.com](mailto:kim...@gmail.com) wrote:

> Btw, we also need a method that cluster out of clusters (the reduce phase from all the shards).

I have something like that, see [Facet for clustering geo\_points · Issue #1689 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1689).

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [February 12, 2012, 11:54am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/7 "2012-02-12T11:54:12Z")

</div>

Cheers!, will be interesting to integrate it as a facet (haven't deep dived into the code). Its too late for 0.19, so 0.20 (and be part of the facet refactoring I am hoping to get to do as well).

On Friday, February 10, 2012 at 6:03 AM, Eric Jain wrote:

> On Feb 8, 11:10 pm, Shay Banon \<[kim...@gmail.com](mailto:kim...@gmail.com) ([http://gmail.com](http://gmail.com))\> wrote:
> 
> > Btw, we also need a method that cluster out of clusters (the reduce phase from all the shards).
> 
> I have something like that, see [Facet for clustering geo\_points · Issue #1689 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/1689).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:39am UTC](https://discuss.elastic.co/t/geo-point-clustering/6615/8 "2017-07-06T03:39:47Z")

</div>


