fixed shapely MultiLineString version issue

see https://gis.stackexchange.com/questions/456266/error-of-multilinestring-object-is-not-iterable
This commit is contained in:
nmatsuda 2023-08-23 17:00:00 -07:00 committed by GitHub
parent 43d4edebee
commit 94930dde48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,7 +38,7 @@ def extractLines(shapefile, tolerance):
elif(simplified.geom_type == "MultiPolygon" or simplified.geom_type == "Polygon"): elif(simplified.geom_type == "MultiPolygon" or simplified.geom_type == "Polygon"):
if(simplified.boundary.geom_type == "MultiLineString"): if(simplified.boundary.geom_type == "MultiLineString"):
for boundary in simplified.boundary: for boundary in simplified.boundary.geoms:
outlist.extend(convertLinestring(boundary)) outlist.extend(convertLinestring(boundary))
else: else:
outlist.extend(convertLinestring(simplified.boundary)) outlist.extend(convertLinestring(simplified.boundary))