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

(cherry picked from commit 36c821d)
  • Loading branch information
suricactus authored and nyalldawson committed Jan 18, 2019
1 parent c913586 commit 97dcdc17990476eaec2d88f515047cf1d91e1ae1
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 97dcdc1

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