TransWikia.com

Debugging Error: Algorithm gdal:dissolve not found in PyQGIS?

Geographic Information Systems Asked by dmjf08 on May 14, 2021

I have difficulties with the processing package. I try to run a simple QGIS dissolve in pyQGIS 3. When I run the line :

from qgis.core import QgsVectorLayer

import processing
from processing.core.Processing import Processing
Processing.initialize()

layer = QgsVectorLayer(layerPath, 'layer 1', 'ogr')

parameters = {'INPUT': layer,
              'OUTPUT': 'memory:'}
dissolved = processing.run('gdal:dissolve', parameters)

In QGIS Python Console, it works fine but when I try it in my script, it sends me the error message in the title.
I run my scripts with a batch that imports all necessary libraries.

The full message is following :

File "C:Program FilesQGIS 3.2appsqgispythonpluginsprocessingtoolsgeneral.py", line 96, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
File "C:Program FilesQGIS 3.2appsqgispythonpluginsprocessingcoreProcessing.py", line 125, in runAlgorithm
    raise QgsProcessingException(msg)
_core.QgsProcessingException: Error: Algorithm gdal:dissolve not found

One Answer

Maybe try 'qgis:dissolve' instead of 'gdal:dissolve.

Or check that Processing Toolbox / Settings / Providers / GDAL is activated?

Answered by pnz on May 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP