Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 97dcdc1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/plugins/processing/algs/gdal/rasterize.py
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 97dcdc1

Please sign in to comment.