<div dir="ltr">should be applied the same fix applied to gdal_calc... <a href="https://github.com/qgis/QGIS/pull/6984">https://github.com/qgis/QGIS/pull/6984</a><div><br></div><div>in that case the problem was interpreting the formula as path... in your case you are escaping a real path</div><div><br></div><div>GdalUtils.escapeAndJoin in getConsoleCommands(...) do escaping... <br></div><div><div><div><div dir="ltr" class="gmail_signature"><br></div><div dir="ltr" class="gmail_signature">Luigi Pirelli</div><div dir="ltr" class="gmail_signature"><br><br>**************************************************************************************************<br>* LinkedIn: <a href="https://www.linkedin.com/in/luigipirelli" target="_blank">https://www.linkedin.com/in/luigipirelli</a><br>* Stackexchange: <a href="http://gis.stackexchange.com/users/19667/luigi-pirelli" target="_blank">http://gis.stackexchange.com/users/19667/luigi-pirelli</a><br>* GitHub: <a href="https://github.com/luipir" target="_blank">https://github.com/luipir</a><br>* Mastering QGIS 2nd Edition:<br>* <a href="https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition" target="_blank">https://www.packtpub.com/big-data-and-business-intelligence/mastering-qgis-second-edition</a><br>* Hire me: <a href="http://goo.gl/BYRQKg" target="_blank">http://goo.gl/BYRQKg</a><br>**************************************************************************************************</div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, 13 Jun 2018 at 12:10, Jorge Gustavo Rocha <<a href="mailto:jgr@di.uminho.pt">jgr@di.uminho.pt</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I was showing a very small use case of the modeler, with just two steps,<br>
to count reindeers in a IR raster. It failed with a very simple error.<br>
If I use spaces in the final output name, it fails. This is not a high<br>
priority issue.<br>
<br>
If I set the output name as 'reindeer polygons', the gdal call is:<br>
<br>
gdal_polygonize.py<br>
/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/dfee0e38cbd1483ca732fd82a12110c5/OUTPUT.tif<br>
"\"/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ef043a13ea8044c4a4ab9fee9c373b1f/gdal_polygonize_1_reindeer<br>
polygons.shp\"" -b 1 -f "ESRI Shapefile"<br>
<br>
But the additional " are not necessary and it will fail. The entire log<br>
is below.<br>
<br>
If the generated string was just (without the additional \"):<br>
<br>
gdal_polygonize.py<br>
/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/dfee0e38cbd1483ca732fd82a12110c5/OUTPUT.tif<br>
"/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ef043a13ea8044c4a4ab9fee9c373b1f/gdal_polygonize_1_reindeer<br>
polygons.shp" -b 1 -f "ESRI Shapefile"<br>
<br>
it works.<br>
<br>
So, it is escaped only if there are spaces on the output name. In Linux<br>
this double escaping fails. Does this escaping works on other OS? Is it<br>
safe to discard this double escaping mechanism?<br>
<br>
Regards,<br>
<br>
J. Gustavo<br>
-- <br>
Jorge Gustavo Rocha<br>
Departamento de Informática<br>
Universidade do Minho<br>
4710-057 Braga<br>
Tel: +351 253604480<br>
Fax: +351 253604471<br>
Móvel: +351 910333888<br>
skype: nabocudnosor<br>
<br>
-----------------------------------------------------------------------------------------<br>
<br>
Processing algorithm…<br>
Algorithm 'Counting Reindeer' starting…<br>
Input parameters:<br>
{ 'gdal:polygonize_1:reindeer polygons' :<br>
'/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp', 'infrared' :<br>
'/home/jgr/Documentos/Classification/classification.tif' }<br>
<br>
Prepare algorithm: qgis:rastercalculator_1<br>
Running Raster calculator [1/2]<br>
Input Parameters:<br>
{ CELLSIZE: 1, CRS: 'EPSG:32633', EXPRESSION:<br>
'"<qgis._core.QgsProcessingModelChildParameterSource object at<br>
0x7f0f3e23be58>@1" = 12', EXTENT:<br>
'/home/jgr/Documentos/Classification/classification.tif', LAYERS: '',<br>
OUTPUT:<br>
'/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/b2be67056f714fcca6a0317233b4b134/OUTPUT.tif'<br>
}<br>
OK. Execution took 0.321 s (1 outputs).<br>
Prepare algorithm: gdal:polygonize_1<br>
Running Polygonize (raster to vector) [2/2]<br>
Input Parameters:<br>
{ BAND: 1, EIGHT_CONNECTEDNESS: False, FIELD: 'DN', INPUT:<br>
'/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/b2be67056f714fcca6a0317233b4b134/OUTPUT.tif',<br>
OUTPUT:<br>
'/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp' }<br>
GDAL command:<br>
gdal_polygonize.py<br>
/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/b2be67056f714fcca6a0317233b4b134/OUTPUT.tif<br>
"\"/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp\"" -b 1 -f "ESRI Shapefile" None DN<br>
GDAL command output:<br>
ERROR 1: Failed to create directory<br>
"/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp" for shapefile datastore.<br>
<br>
Creating output<br>
"/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp" of format ESRI Shapefile.<br>
<br>
Traceback (most recent call last):<br>
<br>
File "/usr/bin/gdal_polygonize.py", line 197, in <module><br>
<br>
dst_layer = dst_ds.CreateLayer(dst_layername, geom_type=ogr.wkbPolygon,<br>
srs = srs )<br>
<br>
AttributeError: 'NoneType' object has no attribute 'CreateLayer'<br>
<br>
OK. Execution took 0.144 s (1 outputs).<br>
Model processed OK. Executed 2 algorithms total in 0.772 s.<br>
Execution completed in 0.79 seconds<br>
Results:<br>
{'gdal:polygonize_1:reindeer polygons':<br>
<QgsProcessingOutputLayerDefinition<br>
{'sink':/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp, 'createOptions': {'fileEncoding': 'System'}}>}<br>
<br>
Loading resulting layers<br>
The following layers were not correctly generated.<br>
/tmp/processing_7b5b06e1a8f14ee09ac38187a00ce932/ed2a4eb50e1d4a6ebe98392ea9f1c520/gdal_polygonize_1_reindeer<br>
polygons.shp<br>
You can check the 'Log Messages Panel' in QGIS main window to find more<br>
information about the execution of the algorithm.<br>
<br>
_______________________________________________<br>
QGIS-Developer mailing list<br>
<a href="mailto:QGIS-Developer@lists.osgeo.org" target="_blank">QGIS-Developer@lists.osgeo.org</a><br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-developer" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/qgis-developer</a></blockquote></div>