-
Notifications
You must be signed in to change notification settings - Fork 562
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
Buffer(0) drops interiors of valid shape #1069
Comments
|
Thanks @tomplex, is it possible that the problem is with |
|
This geometry is valid according to GEOS and JTS. Buffering this polygon in JTS did not drop rings, so I suspect this is a GEOS defect. |
|
Can you post the result of: python -c "import shapely.geos; print(shapely.geos.geos_version)" |
I get |
|
Thanks. I submitted a ticket to the GEOS tracker regarding this issue. For now, I would suggest only buffering invalid geometries, or you could install Shapely from source using the master branch and access the |
Thanks Tom, appreciate it. |
|
This does look like an issue with the GEOS buffer algorithm. And it's a tricky one. |
|
This seems to work with the latest GEOS version (3.11.1): |

Expected behavior and actual behavior.
The shape in this file shape.txt is valid according to
is_valid, so we expectbuffer(0)to have no effect on the shape, instead we're seeing some of the interiors are dropped:Steps to reproduce the problem.
Operating system
Ubuntu 18.04.5 LTS
Shapely version and provenance
Installed with conda:
shapely, 1.7.1, py38hc7361b7_1, conda-forge
The text was updated successfully, but these errors were encountered: