bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.19, 1.20
cvs@intevation.de
cvs at intevation.de
Mon Oct 17 22:10:20 CEST 2005
Author: bernhard
Update of /thubanrepository/thuban/Extensions/svgexport/test
In directory doto:/tmp/cvs-serv29320/Extensions/svgexport/test
Modified Files:
test_svgmapwriter.py
Log Message:
svgexport 1.0.0cvs: Fixed ARC layer writing: No filling is done.
You could actually get polylines with filling in between,
when the classification for the lines had a fill color.
E.g. this happens when you generate a classification from a ramp.
Index: test_svgmapwriter.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/svgexport/test/test_svgmapwriter.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- test_svgmapwriter.py 27 Dec 2004 17:00:15 -0000 1.19
+++ test_svgmapwriter.py 17 Oct 2005 20:10:18 -0000 1.20
@@ -1,12 +1,12 @@
-# Copyright (c) 2004 by Intevation GmbH
+# Copyright (c) 2004,2005 by Intevation GmbH
# Authors:
# Markus Rechtien <markus at intevation.de> (2004)
-# Bernhard Reiter <bernhard at intevation.de> (2004)
+# Bernhard Reiter <bernhard at intevation.de> (2004,2005)
#
# This program is free software under the GPL (>=v2)
# Read the file COPYING coming with Thuban for details.
-"""Tests for svgexport"""
+"""Test the svgexport."""
__version__ = "$Revision$"
# $Source$
@@ -431,6 +431,43 @@
map = Map("testpolygonexport")
self.to_destroy.append(map)
layer=Layer("P-Layer", store, fill=Transparent)
+ map.AddLayer(layer)
+
+ renderer = SVGRenderer(self.dc, map,
+ scale=1.0, offset=(0,0), region=(0,0,10,10))
+ renderer.RenderMap(None, None)
+ #print (data)
+ #print (self.dc.file.getvalue())
+ self.assertEquals(data, self.dc.file.getvalue())
+
+ def test_export_arc_no_fill(self):
+ """Create layer with a linestring and test svg rendering.
+
+ Even when the layer or the classifications have a fill color,
+ the resulting path shall not be filled for an ARC (linestring) layer.
+ """
+
+ data = ('<clipPath id="mapclip">\n'
+ ' <rect x="0" y="0" width="10" height="10" />\n'
+ '</clipPath>\n'
+ '<g meta="Object:map" clip-path="url(#mapclip)" '
+ 'clip-rule="evenodd" transform=" scale(100.0)">\n'
+ ' <g meta="Layer:A-Layer" >\n'
+ ' <path style="stroke-linejoin:round; stroke:#000000; '
+ 'stroke-width:0.01; stroke-linecap:round; fill:none" '
+ 'id="A-Layer_0"'
+ ' d="\nM 0.0 0.0\nL 2.0 -8.0\nL 10.0 -10.0"/>\n'
+ ' </g>\n</g>\n')
+ table = MemoryTable([("type", FIELDTYPE_STRING),
+ ("value", FIELDTYPE_DOUBLE),
+ ("code", FIELDTYPE_INT)],
+ [("UNKNOWN", 0.0, 0)])
+ shapes = [[[(0, 0), (2, 8), (10, 10) ]]]
+ store = SimpleShapeStore(SHAPETYPE_ARC, shapes, table)
+
+ map = Map("testarcexport")
+ self.to_destroy.append(map)
+ layer=Layer("A-Layer", store, fill=Black)
map.AddLayer(layer)
renderer = SVGRenderer(self.dc, map,
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)