-
Notifications
You must be signed in to change notification settings - Fork 366
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
Equivalent polygons are not equal with geos 3.13 #1177
Comments
Well according to In [1]: import shapely; from shapely.geometry import Polygon
In [2]: >>> g11 = Polygon(
...: ... ((97, 98), (99, 101), (102, 103), (101, 108)),
...: ... [((106, 107), (108, 109), (110, 111), (113, 108))],
...: ... )
In [3]: g12 = shapely.from_wkt("POLYGON ((97 98, 99 101, 102 103, 101 108, 97 98), (106 107, 108 109, 110 111, 113 108, 106 107))")
In [4]: g11.equals(g12)
Out[4]: True $ conda list geos
#
# Name Version Build Channel
geos 3.12.2 he02047a_1 conda-forge
$ conda install -c conda-forge geos=3.13
...
$ conda list geos
#
# Name Version Build Channel
geos 3.13.0 h5888daf_0 conda-forge In [1]: import shapely; from shapely.geometry import Polygon
In [2]: >>> g11 = Polygon(
...: ... ((97, 98), (99, 101), (102, 103), (101, 108)),
...: ... [((106, 107), (108, 109), (110, 111), (113, 108))],
...: ... )
In [3]: g12 = shapely.from_wkt("POLYGON ((97 98, 99 101, 102 103, 101 108, 97 98), (106 107, 108 109, 110 111, 113 108, 106 107))")
In [4]: g11.equals(g12)
Out[4]: False Sorry I am not really well versed in geospatial concepts, but you're saying an invalid polygon (or any geometry) is never equal to itself because it is invalid? |
Invalid geometries are simply not handled by the topological predicates. So they may return any result for an invalid geometry. And this may vary according to the version of GEOS used. |
I wonder if our equals() does a quick equalsexact(), particularly for features like polygons that might be invalid in ways that defeat equals(). |
If this is the desired behaviour it's easy for API users to call |
Not sure if this is related to #1170, but I would expected this to be
True
with geos 3.13The text was updated successfully, but these errors were encountered: