arcgis.geometry.Geometry.as_shapely
does not return expected shapely
geometry for multipolygon
#2211
Labels
arcgis.geometry.Geometry.as_shapely
does not return expected shapely
geometry for multipolygon
#2211
Describe the bug
arcgis.geometry.Geometry.as_shapely
does not return expectedshapely
geometry for multipolygon.To Reproduce
Steps to reproduce the behavior:
Coordinates are as expected when calling
Geometry.__geo_interface__
.Not expected geometry when calling

arcgis.geometry.Geometry.as_shapely
. It should be a multipolygon with hole.Not expected
shapely
geometry when it is created byarcgis.geometry.Geometry.as_shapely
. It should be a multipolygon with hole.Use
arcgis.geometry.Geometry.__geo_interface__
andshapely
to createshapely
geometry instead of usingarcgis.geometry.Geometry.as_shapely
.This is the expected
shapely
geometry.This matches the multipolygon with hole example geometry used.
error:
>>> geom.as_shapely == shapely.make_valid(shapely.geometry.shape(geom.__geo_interface__)) Geometry failed validation: Hole lies outside shell[20 35]. Repairing with `buffer(0)`. False
There is no explicit error raised. The issue is unexpected behavior with
arcgis.geometry.Geometry.as_shapely
creating ashapely
geometry that differs from creating ashapely
geometry usingshapely.geometry.shape
.Screenshots
See above.
Expected behavior
I expect
arcgis.geometry.Geometry.as_shapely
to create ashapely
geometry that is equal to callingshapely.geometry.shape
.>>> geom.as_shapely == shapely.make_valid(shapely.geometry.shape(geom.__geo_interface__)) True
For reference, here are docs for how I create
shapely
geometry fromarcgis.geometry.Geometry.__geo_interface__
.Convert geo interface to shapely geometry doc: https://shapely.readthedocs.io/en/2.0.1/manual.html#python-geo-interface
Repair geometry doc: https://shapely.readthedocs.io/en/2.0.1/reference/shapely.make_valid.html
Platform (please complete the following information):
1.6.2
]:2.4.0
Additional context
Add any other context about the problem here, attachments etc.
2.0.1
The text was updated successfully, but these errors were encountered: