Bug report #17079

AttributeError: 'QgsVectorLayer' object has no attribute 'bandCount' in SagaAlgorithm212.py

Added by Nelson A. de Oliveira over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/SAGA
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

Description

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[0], ';'.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?

History

#1 Updated by Giovanni Manghi over 6 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 6 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.

#3 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

A plugin issue then.

#4 Updated by Nelson A. de Oliveira over 6 years ago

Right. Thank you very much for your attention!

#5 Updated by Giovanni Manghi over 6 years ago

Nelson A. de Oliveira wrote:

Right. Thank you very much for your attention!

de nada Nelson. Até a proxima.

Also available in: Atom PDF