Skip to content
Permalink
Browse files
[processing] Fix NODATA parameters in GDAL Merge alg
Set NODATA_INPUT and NODATA_OUTPUT as QgsProcessingParameterNumber.Double parameters, instead of QgsProcessingParameterNumber.Integer
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Sep 10, 2021
1 parent ae4c1b0 commit 44744e2679755ddab4f03403c8b43085d0594021
Showing with 4 additions and 4 deletions.
  1. +4 −4 python/plugins/processing/algs/gdal/merge.py
@@ -71,15 +71,15 @@ def initAlgorithm(self, config=None):

nodata_param = QgsProcessingParameterNumber(self.NODATA_INPUT,
self.tr('Input pixel value to treat as "nodata"'),
type=QgsProcessingParameterNumber.Integer,
type=QgsProcessingParameterNumber.Double,
defaultValue=None,
optional=True)
nodata_param.setFlags(nodata_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(nodata_param)

nodata_out_param = QgsProcessingParameterNumber(self.NODATA_OUTPUT,
self.tr('Assign specified "nodata" value to output'),
type=QgsProcessingParameterNumber.Integer,
type=QgsProcessingParameterNumber.Double,
defaultValue=None,
optional=True)
nodata_out_param.setFlags(nodata_out_param.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
@@ -141,12 +141,12 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
arguments.append('-separate')

if self.NODATA_INPUT in parameters and parameters[self.NODATA_INPUT] is not None:
nodata_input = self.parameterAsInt(parameters, self.NODATA_INPUT, context)
nodata_input = self.parameterAsDouble(parameters, self.NODATA_INPUT, context)
arguments.append('-n')
arguments.append(str(nodata_input))

if self.NODATA_OUTPUT in parameters and parameters[self.NODATA_OUTPUT] is not None:
nodata_output = self.parameterAsInt(parameters, self.NODATA_OUTPUT, context)
nodata_output = self.parameterAsDouble(parameters, self.NODATA_OUTPUT, context)
arguments.append('-a_nodata')
arguments.append(str(nodata_output))

0 comments on commit 44744e2

Please sign in to comment.