Bug report #17079
AttributeError: 'QgsVectorLayer' object has no attribute 'bandCount' in SagaAlgorithm212.py
|Affected QGIS version:||2.14.18||Regression?:||No|
|Operating System:||Linux||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||invalid|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||24978|
While trying to run the Easy AHP plugin in QGIS 2.14.18, with saga 2.3.1 installed I am seeing this:
Traceback (most recent call last): File "/home/naoliv/.qgis2/python/plugins/EasyAHP/easyAHP.py", line 550, in wlcProcessing output = processing.runalg("saga:rastercalculator", files, ';'.join(files[1:]), '+'.join(expression), False, 7, savePath) File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 71, in runalg alg = Processing.runAlgorithm(algOrName, None, *args, **kwargs) File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 334, in runAlgorithm msg = alg._checkParameterValuesBeforeExecuting() File "/usr/share/qgis/python/plugins/processing/core/GeoAlgorithm.py", line 237, in _checkParameterValuesBeforeExecuting return self.checkParameterValuesBeforeExecuting() File "/usr/share/qgis/python/plugins/processing/algs/saga/SagaAlgorithm212.py", line 333, in checkParameterValuesBeforeExecuting if layer.bandCount() > 1: AttributeError: 'QgsVectorLayer' object has no attribute 'bandCount'
It seems that somehow SagaAlgorithm212.py needs to be updated/fixed?
#1 Updated by Giovanni Manghi over 3 years ago
- Status changed from Open to Feedback
If this plugin makes use of QGIS/SAGA then it is probable it the other way around: is this plugin that needs to be updated we now support in qgis only saga LTR while the plugin seems to try make use of saga 2.1.2(?). You may want to install manually saga 2.1.2 on your system and see of it works.
#2 Updated by Nelson A. de Oliveira over 3 years ago
Hum... it seems that I found what is happening:
I am including 3 raster layers to use in Easy AHP.
But then I saw that there is another vector layer with the same name as one of those 3 layers.
ie, I have 3 rasters as A, B, C and a vector layer A
Somehow it is trying to use the vector layer "A" instead the raster layer "A"
If I rename this vector layer "A" to something else, then it properly works.
And I am unsure if this problem is in qgis, saga or the plugin, sorry.