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

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

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

revision 745 by jonathan, Fri Apr 25 10:26:50 2003 UTC revision 749 by jonathan, Fri Apr 25 14:22:35 2003 UTC
# Line 27  class Projection(BaseProjection): Line 27  class Projection(BaseProjection):
27    
28          BaseProjection.__init__(self, params)          BaseProjection.__init__(self, params)
29    
30          if name is None:          self.SetName(name)
31              name = _("Unknown")          self.SetAllParameters(params)
   
         self.params = params  
         self.name = name  
32    
33      def ForwardBBox(self, bbox):      def ForwardBBox(self, bbox):
34          """Return the bounding box of the corners of the bounding box bbox          """Return the bounding box of the corners of the bounding box bbox
# Line 55  class Projection(BaseProjection): Line 52  class Projection(BaseProjection):
52          return self.name          return self.name
53    
54      def SetName(self, name):      def SetName(self, name):
55          """Set the name of the projection."""          """Set the name of the projection.
56          if isinstance(name, StringTypes):  
57            If 'name' is None, the name will be set to 'Unknown'
58            in the local language.
59            """
60    
61            if name is None:
62                self.name = _("Unknown")
63            elif isinstance(name, StringTypes):
64              self.name = name              self.name = name
65    
66      def GetParameter(self, param):      def GetParameter(self, param):
# Line 78  class Projection(BaseProjection): Line 82  class Projection(BaseProjection):
82          """Return list of 'parameter=value' strings"""          """Return list of 'parameter=value' strings"""
83          return self.params          return self.params
84    
85        def SetAllParameters(self, params):
86            """Set the projection's parameters to the given parameter list."""
87            self.params = params
88    
89        def SetProjection(self, proj):
90            """Set the projection properties to those of the given projection.
91    
92            This does not copy the object.
93            """
94    
95            self.SetName(proj.name)
96            self.SetAllParameters(proj.params)
97    
98      def __repr__(self):      def __repr__(self):
99          return self.name + ": " + repr(self.params)          return self.name + ": " + repr(self.params)
100    

Legend:
Removed from v.745  
changed lines
  Added in v.749

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26