Skip to content
Permalink
Browse files

fix a_nodata parameter in gdal processing

  • Loading branch information
Giovanni Manghi
Giovanni Manghi committed Feb 4, 2015
1 parent 7e66e33 commit 98fb59b3da3e4d58f1c8441e4299e7a7cbb2e776
@@ -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 98fb59b

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