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: Don't flip longitude of envelopes crossing dateline #34535
Geo: Don't flip longitude of envelopes crossing dateline #34535
Conversation
When a envelope that crosses the dateline is specified as a part of geo_shape query is parsed it shouldn't have its left and right points flipped. Fixes elastic#34418
Pinging @elastic/es-search-aggs |
It is interesting to see that there was a test to actually check this coercing. I think I would like @nknize to comment here in case this coerce has been added for some use case I am not aware of. Still it seems wrong because it does not allow to build envelopes that crosses the dateline. In the meanwhile I had a look into the documentation: https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-shape.html#_envelope The definition is a bit open:
If we go for this change we should updated it and define that oder of the coordinates is important:
WDYT? |
And thinking about WKT, It would be interesting to test that providing the envelope in Elasticsearch format gives the same result than when it is given in WKT. |
Its been a while, but IIRC the coercion test was for the case where a user provides +1 for making the doc change. |
I don't think coerce can never work because when crossing the dateline then the envelope will be ilegal . We should remove it and change docs to make the order more explicit. |
It should work if the logic is changed to |
Sorry I didn't explained myself properly. It works when providing the right coordinates. |
👍 We would need to correct for that but I agree that the code starts getting far too hairy to support the leniency. +1 for requiring explicit order and documenting in breaking changes. In this case coerce should only be used for normalizing coordinates to -180 : 180 and -90 : 90. |
When a envelope that crosses the dateline is specified as a part of geo_shape query is parsed it shouldn't have its left and right points flipped. Fixes #34418
When a envelope that crosses the dateline is specified as a part of geo_shape query is parsed it shouldn't have its left and right points flipped. Fixes #34418
When a envelope that crosses the dateline is specified as a part of
geo_shape query is parsed it shouldn't have its left and right points
flipped.
Fixes #34418