You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using a buffer to reduce precision error before applying contains operation on my geometries. Geometry that is expected to contain another one gets small buffer applied to catch a cases when there is some rounding issue eg. -85.1234 and -85.123400000000055.
However some polygons after having this operation applied returns empty geometry:
In some rare cases this indeed happens when a negative buffer is applied :-(.
Shapely is actually mainly a python wrapper around a C++ library, GEOS, where the actual algorithms are implemented. So I added this example to an existing issue about this problem in the GEOS project: libgeos/geos#984
Expected behavior and actual behavior.
I'm using a buffer to reduce precision error before applying contains operation on my geometries. Geometry that is expected to contain another one gets small buffer applied to catch a cases when there is some rounding issue eg. -85.1234 and -85.123400000000055.
However some polygons after having this operation applied returns empty geometry:
example polygon:
POLYGON ((-8486160.859752608 4407005.311912118, -8486322.012133999 4419552.266313265, -8498821.965759974 4419382.682467878, -8498646.158633558 4406836.479565462, -8486160.859752608 4407005.311912118))
buffer(1e-9) - ok
buffer(1e-10) - ok
buffer(1e-11) - POLYGON EMPTY
Steps to reproduce the problem.
Operating system
Alpine (docker image - ghcr.io/osgeo/gdal:alpine-small-3.8.2)
Shapely version and provenance
shapely - 2.0.3 installed through poetry
The text was updated successfully, but these errors were encountered: