[QGIS-it-user] input problem with pyqgis gdal:merge
Giacomo Fontanelli
giacomofontanelli76 a gmail.com
Mer 31 Lug 2019 13:41:08 PDT
Dear forum
I need yo stack some rasters using pyqgis
This is the code I wrote
import processing
from processing.core.Processing import Processing
from qgis.core import *
parameters = {'INPUT':
'/home/file1.tif;/home/file2.tif;/home/file3.tif;/home/file4.tif', \
'PCT': False, \
'SEPARATE': False, \
'NODATA_INPUT': 0, \
'NODATA_OUTPUT': 0, \
'OPTIONS': "", \
'DATA_TYPE': 5, \
'OUTPUT': '/home/stack.tif'}
processing.run ('gdal:merge', parameters)
but I get this error
Traceback (most recent call last):
File "/usr/lib/python3.7/code.py", line 90, in runcode
exec(code, self.locals)
File "<input>", line 1, in <module>
File "<string>", line 76, in <module>
File "/usr/share/qgis/python/plugins/processing/tools/general.py", line
106, in run
return Processing.runAlgorithm(algOrName, parameters, onFinish,
feedback, context)
File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line
137, in runAlgorithm
raise QgsProcessingException(msg)
_core.QgsProcessingException: Unable to execute algorithm
Incorrect parameter value for INPUT
I use
QGIS version
3.8.0-Zanzibar
QGIS code revision
11aff65 <https://github.com/qgis/QGIS/commit/11aff65>
Compiled against Qt
5.12.2
Running against Qt
5.12.2
Compiled against GDAL/OGR
2.4.0
Running against GDAL/OGR
2.4.0
Compiled against GEOS
3.7.1-CAPI-1.11.1
Running against GEOS
3.7.1-CAPI-1.11.1 27a5e771
Thank you very much
Grazie
-------------- parte successiva --------------
Un allegato HTML รจ stato rimosso...
URL: <http://lists.osgeo.org/pipermail/qgis-it-user/attachments/20190731/43ad31ac/attachment.html>
Maggiori informazioni sulla lista
QGIS-it-user