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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Tue Sep 10 16:14:35 CEST 2013


Author: bernhard
Date: 2013-09-10 16:14:35 +0200 (Tue, 10 Sep 2013)
New Revision: 2913

Modified:
   trunk/thuban/ChangeLog
   trunk/thuban/Extensions/wms/layer.py
Log:
Extensions/wms/layer.py: Trying the WMS second layer in the list of layers, which often is a real layer. Fallback is the first layer.



Modified: trunk/thuban/ChangeLog
===================================================================
--- trunk/thuban/ChangeLog	2013-09-08 20:44:05 UTC (rev 2912)
+++ trunk/thuban/ChangeLog	2013-09-10 14:14:35 UTC (rev 2913)
@@ -1,3 +1,8 @@
+2013-09-10 Bernhard Reiter <bernhard at intevation.de>
+
+  * Extensions/wms/layer.py: Trying the WMS second layer in the list of layers,
+	which often is a real layer. Fallback is the first layer.
+
 2013-09-08 Bernhard Reiter <bernhard at intevation.de>
 
   Extensions/wms/wms.py: Registering under "Extensions" like the others now.

Modified: trunk/thuban/Extensions/wms/layer.py
===================================================================
--- trunk/thuban/Extensions/wms/layer.py	2013-09-08 20:44:05 UTC (rev 2912)
+++ trunk/thuban/Extensions/wms/layer.py	2013-09-10 14:14:35 UTC (rev 2913)
@@ -108,13 +108,18 @@
         self.capabilities = [op.name for op in self.wmsserver.operations]
         ThubanEndBusyCursor()
 
-        # name of the top layer of the remote map
+        # getting one layer that we want to display first
         layers = list(self.wmsserver.contents)
-        if len(layers) == 0:
+        if len(layers) > 1:
+            # from experience it seems to make sense to try the first
+            # real layer, because the root layer is often less well configured
+            top_layer = layers[1]
+        elif len(layers) == 1:
+            top_layer = layers[0]
+        else:
             self.error_msg = _('No layers found in remote resource:\n'\
                                '%s') % url
             return
-        top_layer = layers[0]
         self.wms_layers = [top_layer]
 
         # first projection of the top layer



More information about the Thuban-commits mailing list