Skip to content
Permalink
Browse files

Merge branch 'fix_gdalmerge_nodata' of https://github.com/NaturalGIS/…

…naturalgis_qgis into fix_gdalmerge_nodata
  • Loading branch information
alexbruy committed Jul 25, 2017
2 parents 3f20650 + 9593a8b commit 43173b8f82835af0a8361d4eb038a624a57200ca
Showing with 7 additions and 0 deletions.
  1. +7 −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

@@ -45,6 +46,7 @@ class merge(GdalAlgorithm):
INPUT = 'INPUT'
OUTPUT = 'OUTPUT'
PCT = 'PCT'
NODATA = 'NODATA'
SEPARATE = 'SEPARATE'
RTYPE = 'RTYPE'

@@ -62,13 +64,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 43173b8

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