/[thuban]/branches/WIP-pyshapelib-bramz/Extensions/wms/layer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Extensions/wms/layer.py

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

revision 2176 by joey, Thu Apr 15 07:13:31 2004 UTC revision 2177 by joey, Thu Apr 15 07:40:32 2004 UTC
# Line 23  Graphic Layer via OGC WMS. Line 23  Graphic Layer via OGC WMS.
23  class WMSLayer:  class WMSLayer:
24      __init__()      __init__()
25    
26        LatLongBoundingBox()
27        BoundingBox()
28    
29        getFormat(format)
30        calcFormat(formats)
31    
32        GetMapImg(width, height, bbox)
33    
34  Requirements:  Requirements:
35      - PyOGCLib <http://www.sourceforge.net/projects/pyogclib>      - PyOGCLib <http://www.sourceforge.net/projects/pyogclib>
# Line 66  def epsg_code_to_projection(epsg): Line 73  def epsg_code_to_projection(epsg):
73    
74    
75  class WMSLayer(BaseLayer):  class WMSLayer(BaseLayer):
76        """
77        WMS Layer
78    
79        This layer incorporates all methods from the Thuban BaseLayer and
80        adds specific methods for operating with a WMS server.
81        """
82    
83      def __init__(self, title, url):      def __init__(self, title, url):
84          """Initializes the WMSLayer.          """Initializes the WMSLayer.
# Line 147  class WMSLayer(BaseLayer): Line 160  class WMSLayer(BaseLayer):
160    
161    
162      def LatLongBoundingBox(self):      def LatLongBoundingBox(self):
163          """Return the layer's bounding box in lat-lon.          """
164            Return the layer's bounding box in lat-lon
165          """          """
166          return self.latlonbbox          return self.latlonbbox
167    
168    
169      def BoundingBox(self):      def BoundingBox(self):
170          """Return the layer's bounding box in the intrinsic coordinate system.          """
171            Return the layer's bounding box in the intrinsic coordinate system
172          """          """
173          return self.bbox          return self.bbox
174    
# Line 163  class WMSLayer(BaseLayer): Line 179  class WMSLayer(BaseLayer):
179    
180          format -- format as returned by the WMS server          format -- format as returned by the WMS server
181    
182          If no mapping was found, None is returned          If no mapping was found, None is returned.
183    
184            This routine uses a simple heuristic in order to find the
185            broken down image format to be used with the internal render
186            engine.
187    
188          An exception rule is implemented in order to not accept          An exception rule is implemented in order to not accept
189          image/wbmp or WBMP which refers to WAP bitmap format and is          image/wbmp or WBMP which refers to WAP bitmap format and is
# Line 212  class WMSLayer(BaseLayer): Line 232  class WMSLayer(BaseLayer):
232                    
233    
234      def GetMapImg(self, width, height, bbox):      def GetMapImg(self, width, height, bbox):
235            """
236            Retrieve a new map from the WMS server and return it
237    
238            width -- width in pixel of the desired image
239            height -- height in pixel of the desired image
240            bbox -- array of min(x,y) max(x,y) in the given SRS
241    
242            SRS and used image format will be retrieved from within the
243            layer itself.
244            """
245          bbox_dict = { 'minx': bbox[0], 'miny': bbox[1],          bbox_dict = { 'minx': bbox[0], 'miny': bbox[1],
246                        'maxx': bbox[2], 'maxy': bbox[3] }                        'maxx': bbox[2], 'maxy': bbox[3] }
247    

Legend:
Removed from v.2176  
changed lines
  Added in v.2177

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26