/[thuban]/trunk/thuban/Thuban/Model/layer.py
ViewVC logotype

Diff of /trunk/thuban/Thuban/Model/layer.py

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

revision 217 by bh, Wed Jul 17 10:50:40 2002 UTC revision 276 by bh, Fri Aug 23 15:25:07 2002 UTC
# Line 7  Line 7 
7    
8  __version__ = "$Revision$"  __version__ = "$Revision$"
9    
10    import os
11  from math import log, ceil  from math import log, ceil
12    
13  import shapelib, shptree  import shapelib, shptree
# Line 83  class BaseLayer(TitledObject, Modifiable Line 84  class BaseLayer(TitledObject, Modifiable
84          """Set the layer's visibility."""          """Set the layer's visibility."""
85          self.visible = visible          self.visible = visible
86          self.issue(LAYER_VISIBILITY_CHANGED, self)          self.issue(LAYER_VISIBILITY_CHANGED, self)
87            
88            
89  class Layer(BaseLayer):  class Layer(BaseLayer):
90    
91      """Represent the information of one geodata file (currently a shapefile)      """Represent the information of one geodata file (currently a shapefile)
# Line 119  class Layer(BaseLayer): Line 120  class Layer(BaseLayer):
120          colors are expected to be instances of Color class          colors are expected to be instances of Color class
121          """          """
122          BaseLayer.__init__(self, title, visible = visible)          BaseLayer.__init__(self, title, visible = visible)
123          self.filename = filename  
124            # Make the filename absolute. The filename will be
125            # interpreted relative to that anyway, but when saving a
126            # session we need to compare absolute paths and it's usually
127            # safer to always work with absolute paths.
128            self.filename = os.path.abspath(filename)
129    
130          self.projection = projection          self.projection = projection
131          self.fill = fill          self.fill = fill
132          self.stroke = stroke          self.stroke = stroke
# Line 159  class Layer(BaseLayer): Line 166  class Layer(BaseLayer):
166              self.shapetree = shptree.SHPTree(self.shapefile.cobject(), 2,              self.shapetree = shptree.SHPTree(self.shapefile.cobject(), 2,
167                                               maxdepth)                                               maxdepth)
168    
169        def Destroy(self):
170            BaseLayer.Destroy(self)
171            if self.shapefile is not None:
172                self.shapefile.close()
173                self.shapefile = None
174                self.shapetree = None
175            self.table.Destroy()
176    
177      def BoundingBox(self):      def BoundingBox(self):
178          """Return the layer's bounding box in the intrinsic coordinate system.          """Return the layer's bounding box in the intrinsic coordinate system.
179    

Legend:
Removed from v.217  
changed lines
  Added in v.276

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26