Skip to content
Permalink
Browse files

Allow gdal_rasterize to accept -init with value of 0; changed default…

… value to not introduce a breaking change
  • Loading branch information
suricactus authored and nyalldawson committed Jan 17, 2019
1 parent 0aae2c1 commit 36c821da34de31074f099a933ffab1bf27c03b3c
Showing with 2 additions and 3 deletions.
  1. +2 −3 python/plugins/processing/algs/gdal/rasterize.py
@@ -127,7 +127,6 @@ def initAlgorithm(self, config=None):
init_param = QgsProcessingParameterNumber(self.INIT,
self.tr('Pre-initialize the output image with value'),
type=QgsProcessingParameterNumber.Double,
defaultValue=0.0,
optional=True)
init_param.setFlags(init_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(init_param)
@@ -181,8 +180,8 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append(self.parameterAsDouble(parameters, self.WIDTH, context))
arguments.append(self.parameterAsDouble(parameters, self.HEIGHT, context))

initValue = self.parameterAsDouble(parameters, self.INIT, context)
if initValue:
if self.INIT in parameters and parameters[self.INIT] is not None:
initValue = self.parameterAsDouble(parameters, self.INIT, context)
arguments.append('-init')
arguments.append(initValue)

0 comments on commit 36c821d

Please sign in to comment.
You can’t perform that action at this time.