/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/Model/save.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/Model/save.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2552 by jonathan, Fri Jan 28 15:54:00 2005 UTC revision 2616 by jonathan, Fri May 6 14:17:29 2005 UTC
# Line 1  Line 1 
1  # Copyright (c) 2001-2004 by Intevation GmbH  # Copyright (c) 2001-2005 by Intevation GmbH
2  # Authors:  # Authors:
3  # Jan-Oliver Wagner <[email protected]> (2004)  # Jan-Oliver Wagner <[email protected]> (2004)
4  # Bernhard Herzog <[email protected]> (2001-2004)  # Bernhard Herzog <[email protected]> (2001-2004)
# Line 26  from Thuban.Model.classification import Line 26  from Thuban.Model.classification import
26      ClassGroupDefault, ClassGroupSingleton, ClassGroupRange, ClassGroupMap      ClassGroupDefault, ClassGroupSingleton, ClassGroupRange, ClassGroupMap
27  from Thuban.Model.transientdb import AutoTransientTable, TransientJoinedTable  from Thuban.Model.transientdb import AutoTransientTable, TransientJoinedTable
28  from Thuban.Model.table import DBFTable, FIELDTYPE_STRING  from Thuban.Model.table import DBFTable, FIELDTYPE_STRING
29  from Thuban.Model.data import DerivedShapeStore, ShapefileStore, \  from Thuban.Model.data import DerivedShapeStore, FileShapeStore, \
30                                SHAPETYPE_POINT                                SHAPETYPE_POINT
31    
32  from Thuban.Model.xmlwriter import XMLWriter  from Thuban.Model.xmlwriter import XMLWriter
# Line 201  class SessionSaver(XMLWriter): Line 201  class SessionSaver(XMLWriter):
201                  continue                  continue
202    
203              idvalue = self.define_id(container)              idvalue = self.define_id(container)
204              if isinstance(container, ShapefileStore):              if isinstance(container, FileShapeStore):
205                  self.define_id(container.Table(), idvalue)                  self.define_id(container.Table(), idvalue)
206                  filename = self.prepare_filename(container.FileName())                  filename = self.prepare_filename(container.FileName())
207                  self.write_element("fileshapesource",                  self.write_element("fileshapesource",
208                                     {"id": idvalue, "filename": filename,                                     {"id": idvalue, "filename": filename,
209                                      "filetype": "shapefile"})                                      "filetype": container.FileType()})
210              elif isinstance(container, DerivedShapeStore):              elif isinstance(container, DerivedShapeStore):
211                  shapesource, table = container.Dependencies()                  shapesource, table = container.Dependencies()
212                  self.write_element("derivedshapesource",                  self.write_element("derivedshapesource",
# Line 303  class SessionSaver(XMLWriter): Line 303  class SessionSaver(XMLWriter):
303              self.close_element("layer")              self.close_element("layer")
304          elif isinstance(layer, RasterLayer):          elif isinstance(layer, RasterLayer):
305              attrs["filename"] = self.prepare_filename(layer.filename)              attrs["filename"] = self.prepare_filename(layer.filename)
306    
307                masknames = ["none", "bit", "alpha"]
308    
309                if layer.MaskType() != layer.MASK_BIT:
310                    attrs["masktype"] = masknames[layer.MaskType()]
311    
312                if layer.Opacity() != 1:
313                    attrs["opacity"] = str(layer.Opacity())
314    
315              self.open_element("rasterlayer", attrs)              self.open_element("rasterlayer", attrs)
316              self.write_projection(layer.GetProjection())              self.write_projection(layer.GetProjection())
317              self.close_element("rasterlayer")              self.close_element("rasterlayer")

Legend:
Removed from v.2552  
changed lines
  Added in v.2616

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26