joey: thuban/Extensions/wms layer.py,1.2,1.3

cvs@intevation.de cvs at intevation.de
Thu Apr 15 10:52:49 CEST 2004


Author: joey

Update of /thubanrepository/thuban/Extensions/wms
In directory doto:/tmp/cvs-serv29132

Modified Files:
	layer.py 
Log Message:
Added more convenience methods for a clear data exchange

Index: layer.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/layer.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- layer.py	15 Apr 2004 07:40:32 -0000	1.2
+++ layer.py	15 Apr 2004 08:52:47 -0000	1.3
@@ -29,6 +29,13 @@
     getFormat(format)
     calcFormat(formats)
 
+    getFormats()
+    getLayers()
+    getLayerTitle()
+
+    getWMSFormat()
+    setWMSFormat(format)
+
     GetMapImg(width, height, bbox)
 
 Requirements:
@@ -230,6 +237,62 @@
                         return f, self.getFormat(f)
         return None, None
         
+
+    def getFormats(self):
+        """
+        Return the list of supported image formats by the WMS server
+
+        These formats may be used in the WMS GetMap request.  Data is
+        retrieved from the included WMSCapabilities object.
+
+        The called method from WMSCapabilities will default to
+        'image/jpeg' if no format is recognised in XML Capabilities,
+        assuming that JPEG will always be supported on the server side
+        with this encoding.
+        """
+        return self.capabilities.getFormats()
+
+
+    def getLayers(self):
+        """
+        Return the list of layer names supported by the WMS server
+
+        Data is retrieved from the included WMSCapabilities object.
+
+        Only named layers will be returned, since a layer may have a
+        title but doesn't have to have a name associated to it as
+        well.  If no layers were found, an empty list is returned.
+        """
+        return self.capabilities.getLayers()
+
+
+    def getLayerTitle(self, layer):
+        """
+        Return the title of the named layer
+
+        Data is retrieved from the included WMSCapabilities object.
+
+        If no such title or no such layer exists, an empty string is
+        returned.
+        """
+        return self.capabilities.getLayerTitle(layer)
+
+
+    def getWMSFormat(self):
+        """
+        Return the image format that is used for WMS GetMap requests
+        """
+        return self.wmsformat
+
+
+    def setWMSFormat(self, format):
+        """
+        Set the image format that is used for WMS GetMap requests
+
+        format -- format, one of getFormats()
+        """
+        self.wmsformat = format
+
 
     def GetMapImg(self, width, height, bbox):
         """





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)