-
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
Orientation of geo_shapes is ignored #35813
Comments
Pinging @elastic/es-analytics-geo |
I think I overshoot here due to my expectations (orientation defines insideness of the polygon) which is not what it is documented. After looking at the implementation and reading careful the documentation, it seems consistent the behaviour. If the orientation of the polygon is different to the provided orientation, then the resulting polygon is the one where the length of the edges is lower than half of the hemisphere. |
This is the current behavior the way I understand it. There are 5 factors that affect how we treat the polygon:
Here is a script that can be used to demonstrate this logic:
|
Hey @imotov just wanted to chime in with a use case where the logic you described is causing an issue: I'm working on a search engine to find NOAA environmental data. Some of our most valuable data products are built using data from the GOES-R series satellites, which are a pair of geostationary satellites centered roughly on the east and west coasts of the US. The extent of these data products reaches from the Japanese coast to central Europe; it's a bounding box which legitimately covers more than 220° of longitude and crosses both meridians. It looks like this in counterclockwise GeoJSON: {
"type": "Polygon",
"orientation": "ccw",
"coordinates": [[
[141.7005, -81.3282],
[6.2995, -81.3282],
[6.2995, 81.3282],
[141.7005, 81.3282],
[141.7005, -81.3282]
]],
} The result of the logic you described in # 1 of your post results in the selection of the smaller, clockwise polygon which does not cross the dateline, i.e. most everywhere on Earth that is not visible to these satellites. After running some experiments it looks like we can work around the issue by translating one of the edges by 360, e.g. so the bbox runs from 141° to 366°. Still, I find it frustrating that you're choosing to index the opposite geometry of what we intend, even if we indicate its Do you think there's any chance this logic will change in the future? Or if perhaps some kind of strict orientation mode could be enabled via the field mapping? |
Hi @mcquinne, I am wondering why you are describing your shape as a polygon instead of describing it as a bounding box, is there any reason in particular? Regarding the current topology model, I agree it can be misleading. We are discussing internally how to transition to a more clear model but of course we need to guarantee backwards compatibility. Still your polygon is incorrect in the sense that if considering a proper ellipsoidal model, the edge between two points should be defined as the shortest path, therefore you cannot have edges bigger than 180 degrees. |
This is already documented in the docs |
It seems the setting
orientation
for geo_shape has no effect. Here is an example:My expectations are that those polygons are different and mutually exclusive, but they seem to represent the same polygon regardless of the order of the vertices.
The text was updated successfully, but these errors were encountered: