Skip to content
Permalink
Browse files

add a nodata option for the gdal merge tool

  • Loading branch information
gioman committed Jul 24, 2017
1 parent ab6dd74 commit 8769991abde7800cea4f8d29c38643913062fe2c
Showing with 6 additions and 0 deletions.
  1. +6 −0 python/plugins/processing/algs/gdal/merge.py
@@ -34,6 +34,7 @@
from processing.core.parameters import ParameterBoolean
from processing.core.parameters import ParameterMultipleInput
from processing.core.parameters import ParameterSelection
from processing.core.parameters import ParameterNumber
from processing.tools.system import isWindows
from processing.algs.gdal.GdalUtils import GdalUtils

@@ -62,13 +63,18 @@ def defineCharacteristics(self):
self.tr('Grab pseudocolor table from first layer'), False))
self.addParameter(ParameterBoolean(merge.SEPARATE,
self.tr('Place each input file into a separate band'), False))
self.addParameter(ParameterNumber(self.NODATA,
self.tr('Assign a specified nodata value to output bands'), None, None, -9999))
self.addParameter(ParameterSelection(self.RTYPE,
self.tr('Output raster type'), self.TYPE, 5))

self.addOutput(OutputRaster(merge.OUTPUT, self.tr('Merged')))

def getConsoleCommands(self):
arguments = []
if self.getParameterValue(merge.NODATA):
arguments.append('-a_nodata')
arguments.append(unicode(self.getParameterValue(merge.NODATA)))
arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])
if self.getParameterValue(merge.SEPARATE):

0 comments on commit 8769991

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