close polygons in svg

This commit is contained in:
Laura Klünder 2017-10-20 12:07:09 +02:00
parent 2f90a79092
commit 05982b2364

View file

@ -141,7 +141,7 @@ class SVGImage:
# scale and move geometry geometry and create svg code for it
if isinstance(geom, Polygon):
return ('<path d="' +
' '.join((('M %.1f %.1f L'+(' %.1f %.1f'*(len(ring.coords)-1))) %
' '.join((('M %.1f %.1f L'+(' %.1f %.1f'*(len(ring.coords)-1))+' z') %
tuple((np.array(ring)*self.np_scale+self.np_offset).flatten()))
for ring in chain((geom.exterior,), geom.interiors))
+ '"/>').replace('.0 ', ' ')