[GRASS-SVN] r74339 - grass/branches/releasebranch_7_6/scripts/r.in.wms

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 3 02:27:39 PDT 2019


Author: neteler
Date: 2019-04-03 02:27:39 -0700 (Wed, 03 Apr 2019)
New Revision: 74339

Modified:
   grass/branches/releasebranch_7_6/scripts/r.in.wms/wms_drv.py
Log:
r.in.wms: catch incorrect WMS url input (trunk r74338)

Modified: grass/branches/releasebranch_7_6/scripts/r.in.wms/wms_drv.py
===================================================================
--- grass/branches/releasebranch_7_6/scripts/r.in.wms/wms_drv.py	2019-04-03 09:26:56 UTC (rev 74338)
+++ grass/branches/releasebranch_7_6/scripts/r.in.wms/wms_drv.py	2019-04-03 09:27:39 UTC (rev 74339)
@@ -63,6 +63,7 @@
         @return temp_map with downloaded data
         """
         grass.message(_("Downloading data from WMS server..."))
+        server_url = self.params["url"]
 
         if "?" in self.params["url"]:
             self.params["url"] += "&"
@@ -187,6 +188,8 @@
                     grass.fatal(_("WMS server unknown error"))
 
             temp_tile_pct2rgb = None
+            if tile_dataset_info.RasterCount < 1:
+                grass.fatal(_("WMS server error: no band(s) received. Is server URL correct? <%s>") % server_url )
             if tile_dataset_info.RasterCount == 1 and \
                tile_dataset_info.GetRasterBand(1).GetRasterColorTable() is not None:
                 # expansion of color table into bands



More information about the grass-commit mailing list