Skip to content
Permalink
Browse files

Merge pull request #2389 from NaturalGIS/gdal_advanced

Processing gdal translate and warp advanced parameters as such
  • Loading branch information
volaya committed Oct 24, 2015
2 parents fd26acd + 03333c8 commit 1dd8e79bafbcc8b2f168965bf64a24e1b84dddcc
Showing with 34 additions and 18 deletions.
  1. +17 −9 python/plugins/processing/algs/gdal/translate.py
  2. +17 −9 python/plugins/processing/algs/gdal/warp.py
@@ -87,27 +87,34 @@ def defineCharacteristics(self):
self.addParameter(ParameterBoolean(self.SDS,
self.tr('Copy all subdatasets of this file to individual output files'),
False))
self.addParameter(ParameterSelection(self.RTYPE,

params = []
params.append(ParameterSelection(self.RTYPE,
self.tr('Output raster type'), self.TYPE, 5))
self.addParameter(ParameterSelection(self.COMPRESS,
params.append(ParameterSelection(self.COMPRESS,
self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4))
self.addParameter(ParameterNumber(self.JPEGCOMPRESSION,
params.append(ParameterNumber(self.JPEGCOMPRESSION,
self.tr('Set the JPEG compression level'),
1, 100, 75))
self.addParameter(ParameterNumber(self.ZLEVEL,
params.append(ParameterNumber(self.ZLEVEL,
self.tr('Set the DEFLATE compression level'),
1, 9, 6))
self.addParameter(ParameterNumber(self.PREDICTOR,
params.append(ParameterNumber(self.PREDICTOR,
self.tr('Set the predictor for LZW or DEFLATE compression'),
1, 3, 1))
self.addParameter(ParameterBoolean(self.TILED,
params.append(ParameterBoolean(self.TILED,
self.tr('Create tiled output (only used for the GTiff format)'), False))
self.addParameter(ParameterSelection(self.BIGTIFF,
params.append(ParameterSelection(self.BIGTIFF,
self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0))
self.addParameter(ParameterBoolean(self.TFW,
params.append(ParameterBoolean(self.TFW,
self.tr('Force the generation of an associated ESRI world file (.tfw))'), False))
self.addParameter(ParameterString(self.EXTRA,
params.append(ParameterString(self.EXTRA,
self.tr('Additional creation parameters'), '', optional=True))

for param in params:
param.isAdvanced = True
self.addParameter(param)

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Converted')))

def getConsoleCommands(self):
@@ -175,6 +182,7 @@ def getConsoleCommands(self):
arguments.append("-co TFW=YES")
if len(bigtiff) > 0:
arguments.append("-co BIGTIFF=" + bigtiff)

arguments.append(self.getParameterValue(self.INPUT))
arguments.append(out)

@@ -75,27 +75,34 @@ def defineCharacteristics(self):
0.0, None, 0.0))
self.addParameter(ParameterSelection(self.METHOD,
self.tr('Resampling method'), self.METHOD_OPTIONS))
self.addParameter(ParameterSelection(self.RTYPE,

params = []
params.append(ParameterSelection(self.RTYPE,
self.tr('Output raster type'), self.TYPE, 5))
self.addParameter(ParameterSelection(self.COMPRESS,
params.append(ParameterSelection(self.COMPRESS,
self.tr('GeoTIFF options. Compression type:'), self.COMPRESSTYPE, 4))
self.addParameter(ParameterNumber(self.JPEGCOMPRESSION,
params.append(ParameterNumber(self.JPEGCOMPRESSION,
self.tr('Set the JPEG compression level'),
1, 100, 75))
self.addParameter(ParameterNumber(self.ZLEVEL,
params.append(ParameterNumber(self.ZLEVEL,
self.tr('Set the DEFLATE compression level'),
1, 9, 6))
self.addParameter(ParameterNumber(self.PREDICTOR,
params.append(ParameterNumber(self.PREDICTOR,
self.tr('Set the predictor for LZW or DEFLATE compression'),
1, 3, 1))
self.addParameter(ParameterBoolean(self.TILED,
params.append(ParameterBoolean(self.TILED,
self.tr('Create tiled output (only used for the GTiff format)'), False))
self.addParameter(ParameterSelection(self.BIGTIFF,
params.append(ParameterSelection(self.BIGTIFF,
self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0))
self.addParameter(ParameterBoolean(self.TFW,
params.append(ParameterBoolean(self.TFW,
self.tr('Force the generation of an associated ESRI world file (.tfw))'), False))
self.addParameter(ParameterString(self.EXTRA,
params.append(ParameterString(self.EXTRA,
self.tr('Additional creation parameters'), '', optional=True))

for param in params:
param.isAdvanced = True
self.addParameter(param)

self.addOutput(OutputRaster(self.OUTPUT, self.tr('Reprojected')))

def getConsoleCommands(self):
@@ -149,6 +156,7 @@ def getConsoleCommands(self):
arguments.append("-co TFW=YES")
if len(bigtiff) > 0:
arguments.append("-co BIGTIFF=" + bigtiff)

arguments.append(self.getParameterValue(self.INPUT))
arguments.append(out)

0 comments on commit 1dd8e79

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