RasterReader does not handle WMS layers

Issue #986 resolved
Benjamin Jakimow created an issue

The RasterReader object fails to be used with a WMS layer instance anf throws errors like:

Traceback (most recent call last):
  File "D:\Repositories\enmap-box\enmapbox\gui\layerconfigwidgets\rasterbandpropertiesconfigwidget.py", line 351, in createWidget
    w = RasterBandPropertiesConfigWidget(layer, canvas, parent=parent)
  File "D:\Repositories\enmap-box\enmapbox\gui\layerconfigwidgets\rasterbandpropertiesconfigwidget.py", line 34, in __init__
    reader = RasterReader(self.mLayer)
  File "D:\Repositories\enmap-box\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "D:\Repositories\enmap-box\enmapboxprocessing\rasterreader.py", line 44, in __init__
    gdalDataset: gdal.Dataset = gdal.Open(self.provider.dataSourceUri(), gdal.GA_ReadOnly)
  File "D:\OSGeo4W\apps\Python39\lib\site-packages\GDAL-3.4.1-py3.9-win-amd64.egg\osgeo\gdal.py", line 4112, in Open
    return _gdal.Open(*args)
RuntimeError: `type=xyz&url=https://mt1.google.com/vt/lyrs%3Dm%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%3D%7Bz%7D&zmax=19&zmin=0' does not exist in the file system, and is not recognized as a supported dataset name.
python-BaseException

How to reproduce

  1. Start EnMAP-Box & create an empty map
  2. Add WMS layer, e.g. map context menu → Add background layer
  3. Double click on the new layer in the Data View panel to open the layer properties dialog

Comments (3)

  1. Log in to comment