Raster Layer Styling error: GDALDataset::GetRasterBand(45) - Illegal band

Issue #1418 resolved
Benjamin Jakimow created an issue

How to replicate

  1. Download & extract example data from https://box.hu-berlin.de/f/d73fa3ba95c143388832/?dl=1
  2. Start QGIS + EnMAP-Box
  3. Drop test data enmap_sonoma.bsq + nlcd_sonoma.bsq onto EnMAP-Box to load and display both
  4. Select enmap_sonoma.bsq in layer tree
  5. Open Raster Layer Styling Panel
  6. Select nlcd_sonoma.bsq

RuntimeError: C:/Users/geo_beja/OneDrive - Humboldt-Universitaet zu Berlin, CMS/ForestSAT2022/tutorial_agb_materials_2022/data/nlcd_sonoma.bsq: GDALDataset::GetRasterBand(45) - Illegal band # 
Traceback (most recent call last):
  File "C:\Users\geo_beja\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps\rasterlayerstylingapp\rasterlayerstylingpanel.py", line 264, in onLayerChanged
    self.updateGui()
  File "C:\Users\geo_beja\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps\rasterlayerstylingapp\rasterlayerstylingpanel.py", line 207, in updateGui
    self.updateWavelengthInfo(mBand)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "C:\Users\geo_beja\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\enmapbox\coreapps\rasterlayerstylingapp\rasterlayerstylingpanel.py", line 388, in updateWavelengthInfo
    wavelength = RasterReader(layer).wavelength(bandNo)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\rasterreader.py", line 483, in wavelength
    wavelength_units = self.wavelengthUnits(bandNo)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\rasterreader.py", line 464, in wavelengthUnits
    for domain in self.metadataDomainKeys(bandNo):
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\rasterreader.py", line 384, in metadataDomainKeys
    domains: List = self._gdalObject(bandNo).GetMetadataDomainList()
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\site-packages\typeguard\__init__.py", line 903, in wrapper
    retval = func(*args, **kwargs)
  File "C:\Users/geo_beja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapboxprocessing\rasterreader.py", line 648, in _gdalObject
    gdalObject = self.gdalDataset.GetRasterBand(bandNo)
  File "F:\OSGeo4W\apps\Python39\lib\site-packages\osgeo\gdal.py", line 2151, in GetRasterBand
    return _gdal.Dataset_GetRasterBand(self, *args)
RuntimeError: C:/Users/geo_beja/OneDrive - Humboldt-Universitaet zu Berlin, CMS/ForestSAT2022/tutorial_agb_materials_2022/data/nlcd_sonoma.bsq: GDALDataset::GetRasterBand(45) - Illegal band #

Comments (1)

  1. Log in to comment