bernhard: thuban/Extensions/svgexport svgmapwriter.py,1.9,1.10
cvs@intevation.de
cvs at intevation.de
Sat Dec 11 03:25:38 CET 2004
Author: bernhard
Update of /thubanrepository/thuban/Extensions/svgexport
In directory doto:/tmp/cvs-serv29974/Extensions/svgexport
Modified Files:
svgmapwriter.py
Log Message:
Made sure that newlines are inserted in the svg path d attributes
to raise the chance that the line length will be below 255 characters,
as recommended by REC SVG 1.1 in section 8.3.1.
* Extensions/svgexport/svgmapwriter.py(DrawPolygon):
Adding \n before L's and changed whitespace handling.
* Extensions/svgexport/test/test_svgmapwriter.py:
Adapted tests to new whitespace handling of DrawPolygon.
Index: svgmapwriter.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/svgmapwriter.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- svgmapwriter.py 11 Dec 2004 02:03:47 -0000 1.9
+++ svgmapwriter.py 11 Dec 2004 02:25:36 -0000 1.10
@@ -689,13 +689,13 @@
i = 0
for point in polygon:
if i is 0:
- data.append('M %s %s ' % (point.x, point.y))
+ data.append('M %s %s' % (point.x, point.y))
i+=1
else:
- data.append('L %s %s ' % (point.x, point.y))
- # FIXME: Determine if path is closed
+ # SVG 1.1 Spec 8.3.1 recommends that lines length <= 255
+ data.append('\nL %s %s' % (point.x, point.y))
if closed:
- data.append('Z')
+ data.append(' Z')
# Put everything together and write it to the file
self.file.write('%s %s d="%s"/>\n' % (self.make_id(),
self.make_meta(), join(data, '') ) )
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)