Skip to content

Commit

Permalink
fix a_nodata parameter in gdal processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Giovanni Manghi committed Feb 4, 2015
1 parent 7e66e33 commit 98fb59b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions python/plugins/processing/algs/gdal/ClipByExtent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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')
Expand Down
9 changes: 5 additions & 4 deletions python/plugins/processing/algs/gdal/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 98fb59b

Please sign in to comment.