Skip to content

Commit

Permalink
add a nodata option for the gdal merge tool
Browse files Browse the repository at this point in the history
  • Loading branch information
gioman committed Jul 24, 2017
1 parent ab6dd74 commit 8769991
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions python/plugins/processing/algs/gdal/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 8769991

Please sign in to comment.