-
Notifications
You must be signed in to change notification settings - Fork 373
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
BUG: valid geometry fails with topology error in GEOSGeom_setPrecision #811
Comments
This produces the same error if you convert the hole to a polygon, so it isn't specific to the ring being part of the hole rather than exterior:
One workaround I discovered for this polygon was to use GEOSDensify to add more points before setting the precision. |
I've confirmed this is reproducible in C++ land, with a test 24 in GeometryPrecisionReducerTest,
It does seem very sensitive to the particular scale factor used, but the one in the test does generate an error
|
This produces the same error as the C API. |
Here's a reduced polygon which produces the error:
|
This is due to a bug in a |
Using the default flag to produce valid outputs, an input polygon that is valid, and a precision of 0.00001, I'm getting
(via shapely 2.0 & latest build from GEOS
main
)for this geometry:
The part that is running into an issue has a very narrow extension of the hole in the polygon:
In this case, the desired behavior is to eliminate that very narrow cut.
It seems that it is sensitive to the order of magnitude of the precision parameter: 0.0001 and 0.000001 both work fine, but 0.00001 - 0.00008 fails
I'm getting entirely different results in geosop, so I'm either not using that correctly or there is a different error there:
and likewise the pointwise operation returns invalid looking data:
❯ geosop reducePrecisionPointwise 0.00001 -a /tmp/test.wkt 10ms POLYGON ((0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0), (0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0))
The text was updated successfully, but these errors were encountered: