Skip to content

Conversation

craigtaverner
Copy link
Contributor

Based on the work in #125143, this PR adds support for generating geo_shape geometries for geohash, geotile and geohex grid cells. The reason for removing it from the original PR is that these geometries cannot be used directly for searching for docs, and we were concerned we might give that impression.

If a user wishes to search for docs in grid cells they must use the grid cellid. Using geometries will give slightly different results because it does not take into account points that are on the edge of cells (which can only be in one cell, but will be seen to intersect with both geometries), as well as the more extreme case of H3 cells which have edges which follow great circle lines, while Elasticsearch geo_shape geometries have edges following mercator projection lines.

So these functions primary utility is in visualization of cells in maps, just like visualizing any other geometry, and should not be considered true representations of the grid cells they originally came from. This limitation would be true in any other GIS database and is not specific to Elasticsearch or ES|QL.

This is because we want to move the ST_GEOXXX functions to produce longs only, for performance reasons, and need the convenience functions to display these either as strings or as actual shapes.

This is both useful to the users, as well as easier to do manual tests where we visualize the results on a map.
This involved copying the H3 utils from spatial plugin to esql. We should rather find a common location or dependency for these.
@craigtaverner craigtaverner added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL labels May 21, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@elasticsearchmachine
Copy link
Collaborator

Hi @craigtaverner, I've created a changelog YAML for you.

@craigtaverner craigtaverner changed the title Esql grid to geoshape ES|QL Functions to generate geo_shape geometries from grid cells May 21, 2025
@craigtaverner
Copy link
Contributor Author

This work was done differently in #129581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL :Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants