Skip to content
Permalink
Browse files

Merge pull request #2391 from NaturalGIS/processing_gdal_rasterize_ad…

…vanced

processing add option for additional parameters for gdal rasterize
  • Loading branch information
volaya committed Oct 24, 2015
2 parents cd0eb05 + c0919e0 commit 07bd3ffedde13480bcab6459ffa5b0147f5202ce
Showing with 7 additions and 0 deletions.
  1. +7 −0 python/plugins/processing/algs/gdal/rasterize.py
@@ -45,6 +45,7 @@ class rasterize(OgrAlgorithm):
DIMENSIONS = 'DIMENSIONS'
WIDTH = 'WIDTH'
HEIGHT = 'HEIGHT'
EXTRA = 'EXTRA'
RTYPE = 'RTYPE'
OUTPUT = 'OUTPUT'
TYPE = ['Byte', 'Int16', 'UInt16', 'UInt32', 'Int32', 'Float32', 'Float64']
@@ -99,6 +100,8 @@ def defineCharacteristics(self):
self.tr('Control whether the created file is a BigTIFF or a classic TIFF'), self.BIGTIFFTYPE, 0))
self.addParameter(ParameterBoolean(self.TFW,
self.tr('Force the generation of an associated ESRI world file (.tfw)'), False))
params.append(ParameterString(self.EXTRA,
self.tr('Additional creation parameters'), '', optional=True))

for param in params:
param.isAdvanced = True
@@ -119,6 +122,7 @@ def getConsoleCommands(self):
bigtiff = self.BIGTIFFTYPE[self.getParameterValue(self.BIGTIFF)]
tfw = unicode(self.getParameterValue(self.TFW))
out = self.getOutputValue(self.OUTPUT)
extra = unicode(self.getParameterValue(self.EXTRA))

arguments = []
arguments.append('-a')
@@ -156,7 +160,10 @@ def getConsoleCommands(self):
arguments.append("-co TFW=YES")
if len(bigtiff) > 0:
arguments.append("-co BIGTIFF=" + bigtiff)
if len(extra) > 0:
arguments.append(extra)
arguments.append('-l')

arguments.append(self.ogrLayerName(inLayer))
arguments.append(ogrLayer)

0 comments on commit 07bd3ff

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