Geotile_grid

Geotile grid aggregation

/ Geotile_grid, / Aggregation

Geotile grid aggregation #

A multi-bucket aggregation grouping geo_point values into zoom/x/y map tiles — the native grid of web maps. Where geohash_grid speaks in geohash strings, this one emits exactly the tile addresses a Leaflet/MapLibre layer already understands, so clustering needs no coordinate translation.

How it works #

Each point is mapped to its Web-Mercator tile: x and y are computed from longitude/latitude scaled by 2^zoom, latitude clamped to the projection’s ±85.0511° limit. precision is the zoom level — 0–29, default 7 (a tile spans ~300 km at the equator; each zoom step halves it). The bucket key is the z/x/y string, e.g. Amsterdam at zoom 8 → 8/131/84.

...