-
Notifications
You must be signed in to change notification settings - Fork 24
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
Union and Intersection Degenerate Case #166
Comments
Seems to work with |
@jaakkor2 I am not convinced it is that problem. Both sets of coordinates above are oriented clockwise, so their winding order is the same in my original question, while the GEOS issue relates to opposite winding orders. This can be seen as follows:
which will return true.
As you can see below, this actually creates a multipolygon! Finally, we take the intersection:
To me, these three totally different answers are suggesting that these functions don't support the degenerate case of two polygons being aligned directly along an edge. This is supported by the function working when the polygons are slightly perturbed so that they don't line up directly. Clearly this is a problem with the algorithm used by the underlying code base, but it is worth noting here so that users are aware. |
Flipping winding of
gives
|
Sorry that these coordinates are complicated, I haven't been able to recreate with simpler coordinates.
When plotted, they look like follows:
They don't appear to be overlapping. However, the union is the lower of the two polygons, and the intersection is the bottom.
All polygons are valid if tested with
ifValid
. This doesn't happen if I set up two squares that share a border. Then the intersection is the line between them, and the union is a larger rectangle made of both.Please let me know if I am missing something.
The text was updated successfully, but these errors were encountered: