Skip to content
Permalink
Browse files

Merge pull request #1643 from gioman/gdal_rasterize_type

Add option to allow choose raster type output to gdal_rasterize
  • Loading branch information
volaya committed Oct 20, 2014
2 parents 9bc7eca + 3c24615 commit f3e7a3ed17bb3a7f06a79d826446d1dfd6db4122
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 f3e7a3e

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