Skip to content

Commit

Permalink
Allow gdal_rasterize to accept -init with value of 0; changed default…
Browse files Browse the repository at this point in the history
… value to not introduce a breaking change
  • Loading branch information
suricactus authored and nyalldawson committed Jan 17, 2019
1 parent 0aae2c1 commit 36c821d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/plugins/processing/algs/gdal/rasterize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 36c821d

Please sign in to comment.