Bug report #18215

Processing: problems outputting raster layers from a model as a "final result"

Added by Alister Hood almost 3 years ago. Updated over 2 years ago.

Status:Closed
Priority:Normal
Assignee:Victor Olaya
Category:Processing/Modeller
Affected QGIS version:3.1(master) Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:26106

Description

I'm not sure if this is an issue with Processing itself, or with the QGIS raster algorithms, so please reassign as appropriate.

I tried to use the raster calculator in a processing model. First, in the model I gave the output a name (i.e. for a "final result") that had a space in it - "Corrected DEM". When running the model I didn't specify a name for the final result, and I got this error:

Processing algorithm…
AlgorithmDialog
Input parameters:
{ 'lidardem' : 'S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif', 'lidardemcorrection' : 0, 'qgis:rastercalculator_1:CORRECTED DEM' : 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/90e7047849344ff2988aa6bc5b21d789/qgis:rastercalculator_1:CORRECTED DEM.tif' }

Prepare algorithm: qgis:rastercalculator_1
Running Raster calculator [1/1]
Input Parameters:
{ CELLSIZE: 0, CRS: 'S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif', EXPRESSION: '"<qgis._core.QgsProcessingModelChildParameterSource object at 0x000001AE84BB8318>@1"+0.23', EXTENT: '', LAYERS: ['S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif'], OUTPUT: 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/90e7047849344ff2988aa6bc5b21d789/qgis:rastercalculator_1:CORRECTED DEM.tif' }
OK. Execution took 0.003 s (1 outputs).
Model processed OK. Executed 1 algorithms total in 0.032 s.
Execution completed in 0.06 seconds
Results:
{'qgis:rastercalculator_1:CORRECTED DEM': 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/90e7047849344ff2988aa6bc5b21d789/qgis:rastercalculator_1:CORRECTED ' 'DEM.tif'}

Loading resulting layers
The following layers were not correctly generated.
C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/90e7047849344ff2988aa6bc5b21d789/qgis:rastercalculator_1:CORRECTED DEM.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

I tested and got the same result with the QGIS hillshade algorithm, so clearly processing models (either in general, or these particular ones) don't support "final output" names containing spaces.

I then replaced the space in the first model with an underscore, and when I tried running it I got this error:

Processing algorithm…
AlgorithmDialog
Input parameters:
{ 'lidardem' : 'S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif', 'lidardemcorrection' : 0, 'qgis:rastercalculator_1:CORRECTED_DEM' : 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/11ccb7a031b847cca745b3c16b1d2f16/qgis:rastercalculator_1:CORRECTED_DEM.tif' }

Prepare algorithm: qgis:rastercalculator_1
Running Raster calculator [1/1]
Input Parameters:
{ CELLSIZE: 0, CRS: 'S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif', EXPRESSION: '"<qgis._core.QgsProcessingModelChildParameterSource object at 0x000001AE84BB8318>@1"+0.23', EXTENT: '', LAYERS: ['S:/Jobs/2011 - Hughes Developments Tuakau/calculations/Stormwater/HEC RAS/Terrain/Terrain.existing.tif'], OUTPUT: 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/11ccb7a031b847cca745b3c16b1d2f16/qgis:rastercalculator_1:CORRECTED_DEM.tif' }
OK. Execution took 0.003 s (1 outputs).
Model processed OK. Executed 1 algorithms total in 0.028 s.
Execution completed in 0.05 seconds
Results:
{'qgis:rastercalculator_1:CORRECTED_DEM': 'C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/11ccb7a031b847cca745b3c16b1d2f16/qgis:rastercalculator_1:CORRECTED_DEM.tif'}

Loading resulting layers
The following layers were not correctly generated.
C:/Users/alistair/AppData/Local/Temp/processing_405afe20db5845519fdf6c9e5cabeae3/11ccb7a031b847cca745b3c16b1d2f16/qgis:rastercalculator_1:CORRECTED_DEM.tif
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

It seems to have correctly generated the output, but can't load it for some reason (there is nothing relevant in the log messages panel). Again, I get the same result using the QGIS hillshade algorithm. I also get the same result if I remove the underscore, just in case.

TEST1.model3 (4.16 KB) Alister Hood, 2018-02-26 03:04 AM

TEST2.model3 (4.16 KB) Alister Hood, 2018-02-26 03:04 AM

History

#1 Updated by Nyall Dawson almost 3 years ago

  • Status changed from Open to Feedback

Can you share your model?

#2 Updated by Alister Hood almost 3 years ago

  • Affected QGIS version changed from 3.0.0 to 3.1(master)
  • Operating System set to Windows
  • File TEST2.model3 added
  • File TEST1.model3 added

I just realised that I am testing on the nightly rather than the 3.0 release.
Examples attached - testing on Ubuntu (a slightly old nightly - before 3.0 release) suggests they are Windows only problems.

#3 Updated by Victor Olaya over 2 years ago

Colons are not allowed in Windows filenames. Looks like that's the issue, since your output filenames have colons.

I mean, the temporary names that the modeler is assigning to the non-final outputs have colons, so they are not correctly saved, and the next algorithm in the workflow cannot use those intermediate files

#4 Updated by Nyall Dawson over 2 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed/implemented

Fixed in 3.0/3.2

Also available in: Atom PDF