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
![Image](https://private-user-images.githubusercontent.com/153551732/407427836-0fab449d-97ab-4128-930d-ab68cfeb217d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTc4MTcsIm5iZiI6MTczOTQ1NzUxNywicGF0aCI6Ii8xNTM1NTE3MzIvNDA3NDI3ODM2LTBmYWI0NDlkLTk3YWItNDEyOC05MzBkLWFiNjhjZmViMjE3ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxM1QxNDM4MzdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zM2RjNDZhYTY3NTQ1YTI2MzBlYmRmMTUyMjc2NTIyYWQ0ZTZiZDZhZjJjMTk1NWVmMTZkNDVjMjE4NDZhY2ZkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.XmxcwgY_DVI05us-vRZY6KXKkOH8gBU_I7MDRbR-Uuc)
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: