[QGIS-it-user] problema con python qgis

SC elyparker1 a gmail.com
Mar 30 Lug 2019 14:31:11 PDT


hai passato 5 come parametro, ma è un intero quel metodo non c'è

il feedback e il context sono oggetti qgis,
questo dovrebbe fare al caso tuo
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/tasks.html



Il 30/07/2019 22:53, Giacomo Fontanelli ha scritto:
> salve
>
> sto scrivendo un codice che mi dovrebbe permettere di creare uno 
> raster multibanda (stack raster) con python qgis.
>
> La linea che mi causa l'errore è
>
> processing.run ('gdal:merge', 
> '/home/giacomo/file1.tif;/home/giacomo/file2.tif;/home/giacomo/file3.tif;/home/giacomo/file4.tif', 
> False, False, 5, '/home/giacomo/stack.tif')
>
> l'errore in questione è questo
>
> 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 74, in <module>
>   File "/usr/share/qgis/python/plugins/processing/tools/general.py", 
> line 114, in run
>     return Processing.runAlgorithm(algOrName, parameters, 
> onFinish=post_process, feedback=feedback, context=context)
>   File "/usr/share/qgis/python/plugins/processing/core/Processing.py", 
> line 130, in runAlgorithm
>     if context.feedback() is None:
> AttributeError: 'int' object has no attribute 'feedback
>
>
> Il mio QGIS ha le seguenti caratteristiche
>
> 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
>
>
>
> Sapete dirmi in cosa sbaglio?
>
> Una sintassi simile funzionava perfettamente in QGIS 2.18
>
> Grazie
>
> _______________________________________________
> QGIS-it-user mailing list
> QGIS-it-user a lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/qgis-it-user


-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.osgeo.org/pipermail/qgis-it-user/attachments/20190730/696fdf3d/attachment.html>


Maggiori informazioni sulla lista QGIS-it-user