[Thuban-commits] r2867 - in trunk/thuban: . Extensions/wms

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Dec 3 15:31:02 CET 2008


Author: dpinte
Date: 2008-12-03 15:31:01 +0100 (Wed, 03 Dec 2008)
New Revision: 2867

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/wms/layer.py
Log:
2008-12-03 Didrik Pinte <dpinte at dipole-consulting.com>

    * Extensions/wms/layer.py : bugfix in projection management



Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2008-11-18 09:49:59 UTC (rev 2866)
+++ trunk/thuban/ChangeLog	2008-12-03 14:31:01 UTC (rev 2867)
@@ -1,3 +1,7 @@
+2008-12-03 Didrik Pinte <dpinte at dipole-consulting.com>
+
+    * Extensions/wms/layer.py : bugfix in projection management
+
 2008-11-18 Didrik Pinte <dpinte at dipole-consulting.com>
 
     * libraries/thuban/gdalwarp.cpp : support the use of GDAL MEM driver for GDAL

Modified: trunk/thuban/Extensions/wms/layer.py
===================================================================
--- trunk/thuban/Extensions/wms/layer.py	2008-11-18 09:49:59 UTC (rev 2866)
+++ trunk/thuban/Extensions/wms/layer.py	2008-12-03 14:31:01 UTC (rev 2867)
@@ -124,26 +124,29 @@
             self.error_msg = _('No LatLonBoundingBox found for top layer %s')\
                              % top_layer
             return
-        top_srs = foo[0][foo[0].index(":")+1:]
+        # extract only the EPSG code from the EPSG string 
+        # received 'EPSG:4326' but keep only '4326'
+        top_srs = foo[0].split(':')[1]
 
+        # LatLonBox of the top layer
+        bbox = self.wmsserver.contents[top_layer].boundingBoxWGS84
+        self.latlonbbox = (float(bbox[0]),
+                     float(bbox[1]),
+                     float(bbox[2]),
+                     float(bbox[3])) 
+        
         # BoundingBox of the top layer
-        bbox = self.wmsserver[top_layer].boundingBox
+        # Do we really need to know the bbox not in WGS84 ? 
+        bbox = self.wmsserver.contents[top_layer].boundingBox
         if bbox is None or len(bbox) == 0:
-            self.error_msg = _('No BoundingBox found for layer %s and EPSG %s')\
-                             % (top_layer, top_srs)
+        #    self.error_msg = _('No BoundingBox found for layer %s and EPSG %s')\
+        #                     % (top_layer, top_srs)
             self.bbox = None
         else :
             self.bbox = (float(bbox[0]),
                      float(bbox[1]),
                      float(bbox[2]),
                      float(bbox[3]))
-
-        # LatLonBox of the top layer
-        bbox = self.wmsserver[top_layer].boundingBoxWGS84
-        self.latlonbbox = (float(bbox[0]),
-                     float(bbox[1]),
-                     float(bbox[2]),
-                     float(bbox[3]))
         if self.bbox is None:
             self.bbox =self.latlonbbox
 



More information about the Thuban-commits mailing list