A triangular tessellation based geo_point
encoding supports aggregating on grids other than basic geohash (e.g., triangular, hex). These aggregations provide better spatial visualization but are also commonly used in GIS analysis applications due to their equal area characteristics. This feature issue adds a grid_type
parameter to GeoHashGridParams
(which will likely need to be refactored to GeoGridParams
) to allow users to specify different grid types such as geohash
, triangular
, hexagonal
. We should also investigate generalizing geohash_grid
aggregation to a more general geo_grid
aggregation so we can provide different grid definitions.
Is a solution for this still desired?
Would this include also quad_keys, similar to Bing Maps (https://msdn.microsoft.com/en-us/library/bb259689.aspx)?
The tile-pyramids employed by most mapping services (Web Mercator, 2x2 division) are easier to work with from a front-end perspective than geohash-grids due to the uniform scaling horizontal/vertical across zoom levels.
So something like https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html, but bucketing by tile in the quad-tree.
FWIW I got a user asking for this to me in person recently, the main motivation being to have equally-sized cells.
Relates https://github.com/elastic/elasticsearch/issues/28121 - S2's cells are approximately rectangular and of approximately equal sizes.
I just submitted a pull request #30231 with plus code support - I think that PR can be used as a step towards multi-hashing support.
It would definitely be a good idea to support hexagonal partitioning.
See Uber's open-sourced h3 project (Hexagonal Hierarchical Geospatial Indexing System): https://github.com/uber/h3
Explanations with examples here: https://eng.uber.com/h3/
Update here:
We should also investigate generalizing
geohash_grid
aggregation to a more generalgeo_grid
aggregation so we can provide different grid definitions.
Recently, changes were made to make geogrid aggregations really easy to create. This was done in favor of building one mega-geo-grid aggregation with different types due to concerns over overloading of the precision
field, since precision means something different bucketing algorithm.
geotile_grid was introduced for support for web-xyz-tiling of geopoints.
From a discussion, there is a geohex.net and a related
java port. Also, per @talevy above, i think we should update the issue's main description, e.g. summarize the changes required, benefits, and relevant libraries/specifications as individual sections to avoid digging through comments.
Hexagonal geo aggregation (Uber H3) support in ES would be a great feature, equal area buckets help with data visualization UX. Is it on roadmap?
From @consulthys:
It would definitely be a good idea to support hexagonal partitioning.
See Uber's open-sourced h3 project (Hexagonal Hierarchical Geospatial Indexing System): https://github.com/uber/h3Explanations with examples here: https://eng.uber.com/h3/
From @zakjan:
Hexagonal geo aggregation (Uber H3) support in ES would be a great feature, equal area buckets > help with data visualization UX. Is it on roadmap?
For those who are interested, I've created an Ingest Processor plugin for generating H3 indexes at specified resolutions out of geo-location fields.
The repo is available here: https://github.com/consulthys/elasticsearch-ingest-h3
It works on Elastic Cloud as well!
@consulthys Looks promising, would you mind to include an example how to use it for search bucket aggregation? Similar to https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html
@zakjan
This is not possible yet. H3 indexes are just simple keywords, they have no meaning beyond that until that gets implemented into Elasticsearch (if ever).
All my plugin does is to create the H3 indexes out of a geo_point
field.
I'm mainly using Kepler (https://kepler.gl/) for visualizing H3 indexes for now.
Nice @nyurik !!
You can also try it out live on https://www.tophap.com/ and see how it looks like ;-)
Thanks for the link! The site looks really nice. One of the primary reasons I did it is to see what it would look like on low zooms - how much of a tile warp would happen if someone attempted to analyze planet-scale data.
Most helpful comment
Hexagonal geo aggregation (Uber H3) support in ES would be a great feature, equal area buckets help with data visualization UX. Is it on roadmap?