Each cell corresponds to a map tile as used by many online map sites. Each cell is labeled using a "{zoom}/{x}/{y}" format, where zoom is equal to the user-specified precision.
I don't know if google maps knows how to use that but for sure, Kibana does know it.
Thanks , Just for the reference can you give me some links how other major map sites can render this response.
{
"key" : "8/131/84",
"doc_count" : 3
}
I checked Mapbox, Leaflet. We can pass them Geojson data. but not sure how to pass tileid and aggregation count. It will be great if you can point me in the right direction.
I'm an engineer on the Kibana team. The GeoTile Grid aggregation returns a key to a specific tile in the Web Mercator coordinate system. There are open source libraries such as SphericalMercator which can convert the tile key to a bounding box.
For heat maps you might want to request a GeoTile aggregation with a higher precision than the current zoom level of the client map. So if the map is on zoom level 8, you may want to set a precision of 10-12 for the geo_grid aggregation. Then you can convert the aggregation results (tile keys & doc_counts) to centroids and use a client-side heatmap generator (ex. Mapbox, Leaflet) to display the results. This is how Elastic Maps creates heat maps.
@nickpeihl, Thanks a ton . Understood it now.
Couple of more points -
How can I find what different tiles a city(washington or newyork) or a bounding box would cover at a certain zoom level. Any easy way to find out all tiles at highest zoom level a city or a bounding box would cover ?
I am planning to precreate geojson for each city at 10-12 zoom level and pass precreated JSON file as response to client for that city. So that client side map libraries can render the heatmaps.
For a quick look at which tiles cover a certain area, I use bboxfinder. For scripting, tilebelt may be useful. It has functions like bboxToTile and getChildren that may help. Perhaps you can use those functions directly or look at the math in the source code to figure out what you need.
thanks @nickpeihl
Also for performance considerations on device is clustering better than heatmap. ?
In your earlier reply you mentioned that For heat maps you might want to request a GeoTile aggregation with a higher precision than the current zoom level of the client map. Dont I have to do same stuff If I do clustering ?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.