<div dir="ltr"><div>Ciao Matteo e grazie per i consigli<br></div><div><br></div><div>Ho trovato la soluzione:</div><div><br></div><div>Con QGIS 2.x i raster layer in INPUT erano dati sottoforma di una stringa con questa forma<br></div><div>'/home/File1.tif;/home/File2.tif;/home/File3.tif'</div><div><br></div><div>Con QGIS 3.x invece si usa direttamente una lista, come ['/home/File1.tif', '/home/File2.tif', '/home/File3.tif'] <br></div><div><br></div><div>In pratica questa è la parte incriminata del mio codice</div><div><br></div><div>parameters = {'DATA_TYPE' : 5, \<br> 'INPUT' : inputList, \<br> 'NODATA_INPUT' : None, \<br> 'NODATA_OUTPUT' : None, \<br> 'OPTIONS' : '', \<br> 'OUTPUT' : outputStack, \<br> 'PCT' : False, \<br> 'SEPARATE' : True }<br><br>processing.run ('gdal:merge', parameters)<br></div><div><br></div><div><br></div><div><br></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid #d3d4de">
<tr>
<td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:17px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Mail priva di virus. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a> </td>
</tr>
</table>
<a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il giorno gio 1 ago 2019 alle ore 07:08 matteo <<a href="mailto:matteo.ghetta@gmail.com">matteo.ghetta@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ciao Giacomo,<br>
<br>
<br>
> e l'errore è<br>
> <br>
> Traceback (most recent call last):<br>
> File "/usr/lib/python3.7/code.py", line 90, in runcode<br>
> exec(code, self.locals)<br>
> File "<input>", line 1, in <module><br>
> File "<string>", line 76, in <module><br>
> File "/usr/share/qgis/python/plugins/processing/tools/general.py",<br>
> line 106, in run<br>
> return Processing.runAlgorithm(algOrName, parameters, onFinish,<br>
> feedback, context)<br>
> File "/usr/share/qgis/python/plugins/processing/core/Processing.py",<br>
> line 137, in runAlgorithm<br>
> raise QgsProcessingException(msg)<br>
> _core.QgsProcessingException: Unable to execute algorithm<br>
> Incorrect parameter value for INPUT<br>
<br>
e l'errore è giustificato ;)<br>
<br>
INPUT: Input layers<br>
<br>
Parameter type: QgsProcessingParameterMultipleLayers<br>
<br>
Accepted data types:<br>
- list[str]: list of layer IDs<br>
- list[str]: list of layer names<br>
- list[str]: list of layer sources<br>
- list[QgsMapLayer]<br>
- QgsProperty<br>
<br>
<br>
devi mettere i vari path dentro una lista:<br>
<br>
parameters = {'INPUT':<br>
['/home/giacomo/aa/a1.tif;/home/giacomo/aa/a2.tif;/home/giacomo/aa/a10.tif;/home/giacomo/aa/a21.tif'],<br>
\<br>
'PCT': False, \<br>
'SEPARATE': False, \<br>
'NODATA_INPUT': 0, \<br>
'NODATA_OUTPUT': 0, \<br>
'OPTIONS': "", \<br>
'DATA_TYPE': 5, \<br>
'OUTPUT': pathOutStack}<br>
</blockquote></div>