-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Geo: extract dateline handling logic from ShapeBuilders #44187
Conversation
Extracts dateline decomposition logic from ShapeBuilder into a separate utility class that is used on the indexing side. The search side will be handled as part of another PR at this time we will remove the decomposition logic from ShapeBuilders as well. This PR also doesn't change any existing logic including bugs.
Pinging @elastic/es-analytics-geo |
So it looks like this always assumes spherical geometries and splits across the 180 degree longitude boundary. To support XY cartesian geometries I think we should either:
I like 2 because I think it makes the building logic more friendly for the REST API? |
@elasticmachine run elasticsearch-ci/default-distro @nknize I was thinking about going the first route actually. I would like to make the Indexing logic easily swap-able, in order to fix the issues that I have stumbled upon this refactoring (such as #43916, #43837, #43826, #43775) in a backward-compatible manner. |
server/src/test/java/org/elasticsearch/common/geo/GeometryIndexerTests.java
Outdated
Show resolved
Hide resolved
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.
LGTM I can't wait for the follow-up PR that removes all the other stuff!
@imotov Just a quick follow up from our conversation: are you still planning on moving |
I don't think I can do that. It will probably be needed in QueryBuilders. |
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.
It will probably be needed in QueryBuilders.
Okay, let's do it in a separate PR then when we refactor the queries.
|
||
ShapeType shapeType = ShapeType.forName(type); | ||
ShapeType shapeType; | ||
if ("bbox".equals(type.toLowerCase(Locale.ROOT))) { |
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.
should we just use equalsIgnoreCase
instead of transforming the type string toLowerCase?
Changes in elastic#44187 introduced some optimization in the way shapes are generated. These changes were not captured in GeoWKTShapeParserTests.
Extracts dateline decomposition logic from ShapeBuilder into a separate utility class that is used on the indexing side. The search side will be handled as part of another PR at this time we will remove the decomposition logic from ShapeBuilders as well. This PR also doesn't change any existing logic including bugs. Relates to #40908
Extracts dateline decomposition logic from ShapeBuilder into a separate
utility class that is used on the indexing side. The search side
will be handled as part of another PR at this time we will remove
the decomposition logic from ShapeBuilders as well. This PR also doesn't
change any existing logic including bugs.
Relates to #40908