Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Triangle and Hex Grid Encoding for GeoGridAggregator #16895

Closed
nknize opened this issue Mar 2, 2016 · 16 comments
Closed

Add Triangle and Hex Grid Encoding for GeoGridAggregator #16895

nknize opened this issue Mar 2, 2016 · 16 comments
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@nknize
Copy link
Contributor

nknize commented Mar 2, 2016

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.

@nknize nknize added >feature :Analytics/Geo Indexing, search aggregations of geo points and shapes :Analytics/Aggregations Aggregations discuss labels Mar 2, 2016
@djminkus
Copy link

djminkus commented Feb 7, 2017

Is a solution for this still desired?

@thomasneirynck
Copy link
Contributor

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.

@jpountz
Copy link
Contributor

jpountz commented Feb 1, 2018

FWIW I got a user asking for this to me in person recently, the main motivation being to have equally-sized cells.

@DaveCTurner
Copy link
Contributor

DaveCTurner commented Feb 1, 2018

Relates #28121 - S2's cells are approximately rectangular and of approximately equal sizes.

@nyurik
Copy link
Contributor

nyurik commented Apr 29, 2018

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.

@consulthys
Copy link
Contributor

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/

@talevy
Copy link
Contributor

talevy commented Feb 5, 2019

Update here:

We should also investigate generalizing geohash_grid aggregation to a more general geo_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.

@nyurik
Copy link
Contributor

nyurik commented Feb 13, 2019

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.

@zakjan
Copy link

zakjan commented Jun 9, 2019

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?

@consulthys
Copy link
Contributor

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/h3

Explanations 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!

@zakjan
Copy link

zakjan commented Oct 25, 2019

@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

@consulthys
Copy link
Contributor

consulthys commented Oct 25, 2019

@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.

@nyurik
Copy link
Contributor

nyurik commented Dec 19, 2019

I did a bit of QGIS-based prototyping to see what it would actually look like as one would pan/zoom:
hex grid

@consulthys
Copy link
Contributor

Nice @nyurik !!
You can also try it out live on https://www.tophap.com/ and see how it looks like ;-)
tophap_h3

@nyurik
Copy link
Contributor

nyurik commented Dec 19, 2019

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.

@rjernst rjernst added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 4, 2020
@wchaparro
Copy link
Member

Completed GeoGridAggregation on H3 hex grid - we'll open a new issue if we want to support a new grid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >feature Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

No branches or pull requests