jan: thuban/Thuban/Model save.py,1.39,1.40

cvs@intevation.de cvs at intevation.de
Thu Oct 7 16:19:50 CEST 2004


Author: jan

Update of /thubanrepository/thuban/Thuban/Model
In directory doto:/tmp/cvs-serv14562

Modified Files:
	save.py 
Log Message:
(SessionSaver.write_classification): Write attribute 'size' for cldata
when the shape layer is of point type. This also now make the
test_load.py tests happy.


Index: save.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/Model/save.py,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- save.py	12 Mar 2004 12:19:15 -0000	1.39
+++ save.py	7 Oct 2004 14:19:48 -0000	1.40
@@ -1,8 +1,10 @@
-# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH
+# $Id$
+# Copyright (c) 2001-2004 by Intevation GmbH
 # Authors:
-# Jan-Oliver Wagner <jan at intevation.de>
-# Bernhard Herzog <bh at intevation.de>
-# Jonathan Coles <jonathan at intevation.de>
+# Jan-Oliver Wagner <jan at intevation.de> (2004)
+# Bernhard Herzog <bh at intevation.de> (2001-2004)
+# Jonathan Coles <jonathan at intevation.de> (2003)
+# Frank Koormann <frank at intevation.de> (2003)
 #
 # This program is free software under the GPL (>=v2)
 # Read the file COPYING coming with Thuban for details.
@@ -23,7 +25,8 @@
     ClassGroupDefault, ClassGroupSingleton, ClassGroupRange, ClassGroupMap
 from Thuban.Model.transientdb import AutoTransientTable, TransientJoinedTable
 from Thuban.Model.table import DBFTable, FIELDTYPE_STRING
-from Thuban.Model.data import DerivedShapeStore, ShapefileStore
+from Thuban.Model.data import DerivedShapeStore, ShapefileStore, \
+                              SHAPETYPE_POINT
 
 from Thuban.Model.xmlwriter import XMLWriter
 from postgisdb import PostGISConnection, PostGISShapeStore
@@ -343,6 +346,10 @@
             dict = {'stroke'      : data.GetLineColor().hex(),
                     'stroke_width': str(data.GetLineWidth()),
                     'fill'        : data.GetFill().hex()}
+
+            # only for point layers write the size attribute
+            if layer.ShapeType() == SHAPETYPE_POINT:
+                dict['size'] =  str(data.GetSize())
 
             self.open_element(open_el)
             self.write_element("cldata", dict)





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)