-
Notifications
You must be signed in to change notification settings - Fork 25k
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
geohash_grid aggregation: Add support for geo_shape #21293
Comments
I'll update the code for this to show how this can be done in the aggregation. Below is a code snippet for computing the geohash cells for a shape. It can be done for quad tree as well for natural mercator matching. // build poly
ctx = JtsSpatialContext.GEO;
Shape shape = ctx.readShapeFromWkt(wkt);
// build geohash prefix tree and iterate intersecting cells
CellIterator iter = new GeohashPrefixTree(ctx, 6).getTreeCellIterator(shape, 6);
while (iter.hasNext()) {
Cell c = iter.next();
System.out.println(c);
} I am a little concerned about the complexity inside the aggregation framework. |
we talked about this at elasticon, it would be an awesome feature that my team would use a lot! |
👍 This would also greatly benefit us (Esri) as well! |
cc @elastic/es-search-aggs |
Have any updates about this question? |
This looks like we don't have agreement yet on whether this is feasible or not. I'll tag this for team discussion to see how we can move this forward or if we don't want to pursue this idea. |
We revisited this topic in the weekly team discussion. The main blocker is that we do not yet have DocValues support for shapes. And we will likely not have doc value support until BKD Backed Shapes is complete. DocValues for shapes is a bit more tricky than it might seem because there is no support for multivalue DocValues. If there were, we could index a docvalue for each decomposed shape term created by the index (either quad cell or tessellated triangle) and use them to compute intersection with the grid bucket(s). Alternatively we could create a single docvalue for each shape that represents the shape in some standard format (e.g., WKB), but then we not only have to unmarshall the docvalue but also recompute the relation between the shape and the aggregation grid cell(s). A linear scan issue that would likely not scale. Since we can't take either of the above approaches we could, alternatively, create a single docvalue for each shape that represents the tessellation of the shape and then compute the intersection of the grid bucket(s) with that tessellation. While this is doable, it is also a linear scan issue that may not scale. Additionally, DocValues have a cap on storage size that would substantially limit the size of the shape in terms of number of vertices. Bottom line, we need to determine an efficient docvalue approach (or alternative) that helps take advantage of the decomposed terms in the index and does not over constrain us on size of the shape. |
Depends on #37206 |
To give some context from the Kibana Maps app perspective, and why this remains relevant. The UX currently disables indices with This difference in support between (A similar issue with the difference in agg support between |
Issue closed by PR #55966, released in v7.8.0 |
Would it be possible to enhance the geohash_grid aggregation to support geo_shape indexes. The functionality would be identical to geo_point with the only difference being that a document would get placed into each grid bucket that intersects the shape.
The text was updated successfully, but these errors were encountered: