-
Notifications
You must be signed in to change notification settings - Fork 558
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
Issue in Union of two intersecting polygons with non-zero areas returns empty #1354
Comments
@stalhabukhari thanks for the report! I can confirm this issue using GEOS 3.10.2 (didn't test master). The union gives an empty polygon, while for example the intersection seems to work correctly:
cc @dr-jts |
A direct geos reproducer using
|
@jorisvandenbossche thanks for the prompt response! I downgraded |
This is fixed in GEOS main with union result Commands for testing:
|
That's good to hear! Do you know if the fix is also backported to 3.10.x? |
This was fixed in GEOS main by libgeos/geos@5ea36b1. It hasn't been backported to the 3.10 series yet. |
This is a (not obvious) duplicate of #1216 ; it would be nice to see this backported, if feasible. |
Now ported to GEOS 3.10 series: libgeos/geos@27fed83 |
Because the #1216 fix was shipped a while back in version 3.11, I had a look here as well and with geos 3.11 the test script above gives the folowing output, which looks good I think:
So, I suppose this issue can be closed as well... |
I encountered few rare cases where the
ops.unary_union
andPolygon.union
methods misbehave, returning an empty polygon.Expected behavior and actual behavior.
In the scenario shown below, there are two polygons with non-zero areas and calculating their union results in an empty polygon with zero area. Instead, their union should have roughly been the larger polygon (since one is a subset of the other) and hence should have a non-zero area.
Output:
684226.9746010096 703839.9967089986 True 0.0 0.0
Plot:
Operating system
Ubuntu
20.04.3
(focal)Shapely version and provenance
1.8.1.post1
installed from PyPI usingpip
The text was updated successfully, but these errors were encountered: