qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.35k stars 2.98k forks source link

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

Closed qgib closed 7 years ago

qgib commented 7 years ago

Author Name: Nelson A. de Oliveira (@naoliv) Original Redmine Issue: 17079 Affected QGIS version: 2.14.18 Redmine category:processing/saga Assignee: Victor Olaya


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?

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


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.


qgib commented 7 years ago

Author Name: Nelson A. de Oliveira (@naoliv)


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.

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


A plugin issue then.


qgib commented 7 years ago

Author Name: Nelson A. de Oliveira (@naoliv)


Right. Thank you very much for your attention!

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


Nelson A. de Oliveira wrote:

Right. Thank you very much for your attention!

de nada Nelson. Até a proxima.