-
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
Rasterize shape during geotilegrid computation #49065
Rasterize shape during geotilegrid computation #49065
Conversation
Pinging @elastic/es-analytics-geo (:Analytics/Geo) |
Thanks @talevy! One thing I was expecting is just one method that returns the relationship between the docValue and the Extent, something like:
Instead you are using two methods, one for |
I started with this route just to make sure the logic was right since conflating both two technical reasons for splitting:
Main reason to join the two
Since the only callers of these methods are the tilers, then maybe combining makes sense. I will try it out and see how it affects performance 👍 |
One example of where it may be nice to have separate within/intersects is with the planned hexgrid aggregation where example photo demonstrating how the sub-tiles are not fully within the parent tile: http://1fykyq3mdn5r21tpna3wkdyi-wpengine.netdna-ssl.com/wp-content/uploads/2018/06/image6-1.png |
79a64c7
to
e3844f3
Compare
This approach will not work for hex grid as a parent cell must contain all the children cells. You can have a shape that is disjoint with the parent cell but intersects a children cell. |
right, there is no concept of "within" in that case. I don't bring it up in the context of rasterization, but just in the context of keeping intersect and within separate. |
server/src/main/java/org/elasticsearch/search/aggregations/bucket/geogrid/GeoGridTiler.java
Outdated
Show resolved
Hide resolved
c1ef005
to
1328c11
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note where we can improve slightly things but not needed for this PR. I think this is an massive improvement so lgtm.
} else { | ||
return crosses(extent); | ||
@Override | ||
public GeoRelation relate(Extent extent) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can move the check of the extent here. Not needed for this PR but I think it is worthy to note.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. consolidating to one relating method reduces the places that there is an extent check. I will follow-up
This PR mainly modifies the existing GeoTileGridTiler to rasterize the GeometryTree instead of iterating through all the tiles found in the bounding box of the shape. This PR also fixes a bug where containsFully was not being calculated correctly and simplifies all the relating logic to one `relate` method relates #37206.
This PR mainly modifies the existing GeoTileGridTiler to rasterize
the GeometryTree instead of iterating through all the tiles found in the
bounding box of the shape.
This PR also fixes a bug where containsFully was not being calculated correctly
relates #37206.