Skip to content
Permalink
Browse files

Add option to allow choose raster type output to gdal_rasterize

  • Loading branch information
Giovanni Manghi
Giovanni Manghi committed Oct 19, 2014
1 parent d2f89c5 commit 3c246159b7b1fd9c95a7b89bf9e7f021611952e9
Showing with 8 additions and 0 deletions.
  1. +8 −0 python/plugins/processing/algs/gdal/rasterize.py
@@ -42,7 +42,10 @@ class rasterize(GdalAlgorithm):
DIMENSIONS = 'DIMENSIONS'
WIDTH = 'WIDTH'
HEIGHT = 'HEIGHT'
RTYPE = 'RTYPE'
OUTPUT = 'OUTPUT'

TYPE = ['Byte','Int16','UInt16','UInt32','Int32','Float32','Float64','CInt16','CInt32','CFloat32','CFloat64']

def commandLineName(self):
return "gdalogr:rasterize"
@@ -60,13 +63,18 @@ def defineCharacteristics(self):
99999999.999999, 100.0))
self.addParameter(ParameterNumber(self.HEIGHT, 'Vertical', 0.0,
99999999.999999, 100.0))
self.addParameter(ParameterSelection(self.RTYPE, 'Raster type',
self.TYPE, 0))

self.addOutput(OutputRaster(self.OUTPUT, 'Output layer'))

def processAlgorithm(self, progress):
arguments = []
arguments.append('-a')
arguments.append(str(self.getParameterValue(self.FIELD)))

arguments.append('-ot')
arguments.append(self.TYPE[self.getParameterValue(self.RTYPE)])

dimType = self.getParameterValue(self.DIMENSIONS)
if dimType == 0:

0 comments on commit 3c24615

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