- fixed an issue in the SVG parser where when parsing a path and getting multiple polygons will generate an invalid compound polygon (the polygons other than the first are seen as interiors even if they are not inside the first)

This commit is contained in:
Marius Stanciu
2022-05-09 16:12:12 +03:00
parent 9dc6c94a45
commit ba7fafb6de
2 changed files with 3 additions and 2 deletions

View File

@@ -202,7 +202,7 @@ def path2shapely(path, object_type, res=1.0, units='MM', factor=1.0):
contained = []
not_contained = []
if len(poly_list) > 1:
for p in poly_list[1:-1]:
for p in poly_list[1:]:
if poly_list[0].contains(p):
contained.append(p)
else:
@@ -217,7 +217,7 @@ def path2shapely(path, object_type, res=1.0, units='MM', factor=1.0):
if contained:
geo_element = Polygon(poly_list[0].exterior, [p.exterior for p in contained])
geometry.append(geo_element)
except Exception as err:
except Exception:
coords = []
for line in rings.geoms:
coords.append(line.coords[0])