ignore invalid rings in svg import

This commit is contained in:
Laura Klünder 2018-12-21 02:05:17 +01:00
parent 9582e8013d
commit b88e9401aa

View file

@ -175,6 +175,8 @@ class Command(BaseCommand):
changed_geometries.reset()
for path in svg.findall('.//svg:path', namespaces):
for polygon in self.parse_svg_data(path.attrib['d']):
if len(polygon) < 3:
continue
polygon = Polygon(polygon)
polygon = scale(polygon, xfact=1, yfact=-1, origin=(0, svg_height/2))
polygon = scale(polygon, xfact=width / svg_width, yfact=height / svg_height, origin=(0, 0))