Cursor Location Value on classification raster throws python error

Issue #232 closed
Fabian Thiel created an issue

By defaut cursor location value is in RBG, which is fine and useful, but for classification rasters it causes an error, after switching to "all band" mode it works again. So maybe we have to account for that (check if raster of type classification --> use "all bands" mode of cursor location value)

2019-01-25T14:02:36     WARNING    Traceback (most recent call last):
              File "C:/Users/geo_fath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\enmapboxgui.py", line 811, in setCurrentLocation
              self.loadCursorLocationValueInfo(spatialPoint, mapCanvas)
              File "C:/Users/geo_fath/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\gui\enmapboxgui.py", line 332, in loadCursorLocationValueInfo
              self.ui.cursorLocationValuePanel.loadCursorLocation(spatialPoint, mapCanvas)
              File "C:\Users\geo_fath\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages\qps\cursorlocationvalue.py", line 344, in loadCursorLocation
              self.reloadCursorLocation()
              File "C:\Users\geo_fath\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\enmapboxplugin\site-packages\qps\cursorlocationvalue.py", line 412, in reloadCursorLocation
              info = RasterValueSet.BandInfo(b - 1, results[b], l.bandName(b))
             KeyError: 0

Comments (2)

  1. Log in to comment