Bug report #19329

gdalcalc raster calculator gives QgsProcessingException (invalidRasterError) when used in a model

Added by Rudi von Staden over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/GDAL
Affected QGIS version:3.2 Regression?:No
Operating System:Windows 10 Easy fix?:Yes
Pull Request or Patch supplied:Yes Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:27157

Description

Using gdal's raster calculator in a model without specifying layers in the optional slots (INPUT_B to INPUT_F) causes an exception.

Using the raster calculator with rasters in only INPUT_A and INPUT_B produces the following exception:

Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\gdal\GdalAlgorithm.py", line 119, in processAlgorithm
commands = self.getConsoleCommands(parameters, context, feedback, executing=True)
File "C:/OSGEO4~1/apps/qgis/./python/plugins\processing\algs\gdal\gdalcalc.py", line 239, in getConsoleCommands
raise QgsProcessingException(self.invalidRasterError(parameters, self.INPUT_C))
_core.QgsProcessingException: Could not load source layer for INPUT_C: invalid value@

Associated revisions

Revision 57fb4ef2
Added by Rudi von Staden over 6 years ago

Add 'not selected' option for optional layer parameters in processing model view

Fixes #19329 (https://issues.qgis.org/issues/19329)

Optional layer parameters in processing algorithms used in the graphical modeler
add an empty string as the default parameter value, which can raise an exception
during algorithm execution. This update replaces the default empty string with a
default 'Not selected' option.

Revision cb3364f1
Added by Rudi von Staden over 6 years ago

Add 'not selected' option for optional layer parameters in processing model view

Fixes #19329 (https://issues.qgis.org/issues/19329)

Optional layer parameters in processing algorithms used in the graphical modeler
add an empty string as the default parameter value, which can raise an exception
during algorithm execution. This update replaces the default empty string with a
default 'Not selected' option.

(cherry-picked from 57fb4ef)

History

#2 Updated by Rudi von Staden over 6 years ago

Tested with QGIS 2.18 and this is a regression.

#3 Updated by Rudi von Staden over 6 years ago

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

Also available in: Atom PDF