/[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 6 by bh, Tue Aug 28 15:41:52 2001 UTC revision 708 by jonathan, Wed Apr 23 08:44:52 2003 UTC
# Line 15  class Projection(BaseProjection): Line 15  class Projection(BaseProjection):
15    
16      """A proj4 projection object that remembers the parameters"""      """A proj4 projection object that remembers the parameters"""
17    
18      def __init__(self, params):      def __init__(self, params, name = "Unknown"):
19          BaseProjection.__init__(self, params)          BaseProjection.__init__(self, params)
20          self.params = params          self.params = params
21            self.name = name
22    
23      def ForwardBBox(self, bbox):      def ForwardBBox(self, bbox):
24          """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 35  class Projection(BaseProjection): Line 36  class Projection(BaseProjection):
36          x, y = self.Forward(urx, lly)          x, y = self.Forward(urx, lly)
37          xs.append(x); ys.append(y)          xs.append(x); ys.append(y)
38          return min(xs), min(ys), max(xs), max(ys)          return min(xs), min(ys), max(xs), max(ys)
39    
40        def GetName(self):
41            return self.name
42    
43        def GetParameter(self, param):
44    
45            for pair in self.params:
46                p, v = pair.split("=")
47                if p == param:
48                    return v
49    
50            return ""
51    
52        def GetAllParameters(self):
53            return self.params
54    
55        def __repr__(self):
56            return repr(self.params)
57    
58    class ProjFile:
59    
60        def __init__(self, filename):
61            self.projs = []
62    
63            self.SetFileName(filename)
64        
65        def Add(self, proj):
66            self.projs.append(proj)
67    
68        def GetFileName(self):
69            return self.filename
70    
71        def SetFileName(self, filename):
72            self.filename = filename
73    
74        def GetProjections(self):
75            return self.projs

Legend:
Removed from v.6  
changed lines
  Added in v.708

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26