remove trailing zeros
This commit is contained in:
parent
ba068f5c93
commit
e320e5d35c
1 changed files with 3 additions and 3 deletions
|
@ -138,12 +138,12 @@ class SVGImage:
|
||||||
' '.join(('M %.1f %.1f L %s z' % (coords[0][0], coords[0][1],
|
' '.join(('M %.1f %.1f L %s z' % (coords[0][0], coords[0][1],
|
||||||
' '.join(('%.1f %.1f' % (c[0], c[1])) for c in coords[1:])))
|
' '.join(('%.1f %.1f' % (c[0], c[1])) for c in coords[1:])))
|
||||||
for coords in chain((geom.exterior.coords,), (ring.coords for ring in geom.interiors)))
|
for coords in chain((geom.exterior.coords,), (ring.coords for ring in geom.interiors)))
|
||||||
+ '"/>')
|
+ '"/>').replace('.0 ', ' ')
|
||||||
if isinstance(geom, LineString):
|
if isinstance(geom, LineString):
|
||||||
return ('<path d="' +
|
return ('<path d="' +
|
||||||
' '.join('M %.1f %.1f L %s' % (geom.coords[0][0], geom.coords[0][1],
|
' '.join('M %.1f %.1f L %s' % (geom.coords[0][0], geom.coords[0][1],
|
||||||
' '.join(('%.1f %.1f' % (c[0], c[1])) for c in geom.coords[1:])))
|
' '.join(('%.1f %.1f' % (c[0], c[1])) for c in geom.coords[1:])))
|
||||||
+ '"/>')
|
+ '"/>').replace('.0 ', ' ')
|
||||||
try:
|
try:
|
||||||
geoms = geom.geoms
|
geoms = geom.geoms
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue