Bug report #17847

Processing Raster Calculator - Problem with spaces in layers name

Added by Pedro Venâncio over 6 years ago. Updated about 6 years 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:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25742

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 over 6 years ago

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

History

#1 Updated by Alexander Bruy over 6 years ago

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

#2 Updated by Giovanni Manghi about 6 years ago

  • Resolution set to fixed/implemented

Also available in: Atom PDF