Bug report #17847

Processing Raster Calculator - Problem with spaces in layers name

Added by Pedro Venâncio 8 days ago. Updated 6 days ago.

Status:Closed
Priority:High
Assignee:Victor Olaya
Category:Processing/QGIS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No

Description

The new Processing Raster Calculator in QGIS 3 (Raster Analysis -> Raster Calculator) does not put the input layer name between double quotes, when double-clicking in the layers name list (like the Raster menu -> Raster Calculator does).

And so, when the layer name has spaces, the algorithm gives an error parsing the formula.

processing.run("qgis:rastercalculator", {'EXPRESSION':'Dem Srtm Pttm06 80m@1 *  1 ','CELLSIZE':0,'OUTPUT':'C:/Users/PedroVenancio/AppData/Local/Temp/processing_c1f8e832dfd0477699ef25f15f41224d/90cbf438721249689c67c573ed894824/OUTPUT.tif'})

With the double quotes, it works well:

processing.run("qgis:rastercalculator", {'EXPRESSION':'"Dem Srtm Pttm06 80m@1" *  1 ','CELLSIZE':0,'OUTPUT':'C:/Users/PedroVenancio/AppData/Local/Temp/processing_c1f8e832dfd0477699ef25f15f41224d/372ee79ce08b43038336049cb24f25b0/OUTPUT.tif'})

Associated revisions

Revision 490aad11
Added by Alexander Bruy 6 days ago

[processing] quote layer names in raster calculator (fix #17847)

History

#1 Updated by Alexander Bruy 6 days ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

Also available in: Atom PDF