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
Update GeoPolygonFilter to handle polygons crossing the dateline #9339
Conversation
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
if (o == null) return false; | ||
if (o instanceof Coordinate) { |
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.
Won't this be true
for any GeoPoint
, so you can never reach the block casting to GeoPoint
?
@nknize I left some comments. |
@rjernst please could you give another review |
return (points[prev].x > points[next].x); | ||
} | ||
|
||
private static final int computePolyTop(GeoPoint[] points, int length) { |
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 still feel like we should make this function name "correct" and maybe call it "computePolyBottomLeft"?
LGTM. I also think having dedicated unit tests for the utility methods in |
4111a93
to
49b323f
Compare
PR elastic#8672 addresses ambiguous polygons - those that either cross the dateline or span the map - by complying with the OGC standard right-hand rule. Since ```GeoPolygonFilter``` is self contained logic, the fix in elastic#8672 did not address the issue for the ```GeoPolygonFilter```. This was identified in issue elastic#5968 This fixes the ambiguous polygon issue in ```GeoPolygonFilter``` by moving the dateline crossing code from ```ShapeBuilder``` to ```GeoUtils``` and reusing the logic inside the ```pointInPolygon``` method. Unit tests are added to ensure support for coordinates specified in either standard lat/lon or great-circle coordinate systems. closes elastic#5968 closes elastic#9304
5155a51
to
06667c6
Compare
PR #8672 addresses ambiguous polygons - those that either cross the dateline or span the map - by complying with the OGC standard right-hand rule. Since
GeoPolygonFilter
is self contained logic, the fix in #8672 did not address the issue for theGeoPolygonFilter
. This was identified in issue #5968This fixes the ambiguous polygon issue in
GeoPolygonFilter
by moving the dateline crossing code fromShapeBuilder
toGeoUtils
and reusing the logic inside thepointInPolygon
method. Unit tests are added to ensure support for coordinates specified in either standard lat/lon or great-circle coordinate systems.closes #5968
closes #9304