Skip to content
Permalink
Browse files

Merge pull request #1880 from gioman/processing_fix_gdal_a_nodata

fix a_nodata parameter in gdal processing
  • Loading branch information
alexbruy committed Feb 4, 2015
2 parents 7e66e33 + 98fb59b commit 91c4e7a37ef1dc4f0802e44ef05bb161aae498eb
@@ -49,8 +49,8 @@ def defineCharacteristics(self):
self.addParameter(ParameterRaster(
self.INPUT, self.tr('Input layer'), False))
self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave as 'none' to take the nodata value from input"),
'none'))
self.tr("Nodata value, leave blank to take the nodata value from input"),
''))
self.addParameter(ParameterExtent(self.PROJWIN, self.tr('Clipping extent')))
self.addParameter(ParameterString(self.EXTRA,
self.tr('Additional creation parameters'), '', optional=True))
@@ -65,8 +65,9 @@ def processAlgorithm(self, progress):
arguments = []
arguments.append('-of')
arguments.append(GdalUtils.getFormatShortNameFromFilename(out))
arguments.append('-a_nodata')
arguments.append(noData)
if len(noData) > 0:
arguments.append('-a_nodata')
arguments.append(noData)

regionCoords = projwin.split(',')
arguments.append('-projwin')
@@ -68,8 +68,8 @@ def defineCharacteristics(self):
self.addParameter(ParameterBoolean(self.OUTSIZE_PERC,
self.tr('Output size is a percentage of input size'), True))
self.addParameter(ParameterString(self.NO_DATA,
self.tr("Nodata value, leave as 'none' to take the nodata value from input"),
'none'))
self.tr("Nodata value, leave blank to take the nodata value from input"),
''))
self.addParameter(ParameterSelection(self.EXPAND,
self.tr('Expand'), ['none', 'gray', 'rgb', 'rgba']))
self.addParameter(ParameterCrs(self.SRS,
@@ -111,8 +111,9 @@ def processAlgorithm(self, progress):
arguments.append('-outsize')
arguments.append(outsize)
arguments.append(outsize)
arguments.append('-a_nodata')
arguments.append(noData)
if len(noData) > 0:
arguments.append('-a_nodata')
arguments.append(noData)
if expand != 'none':
arguments.append('-expand')
arguments.append(expand)

0 comments on commit 91c4e7a

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