I’m working on a script (that later should be used in a processing model) that uses gdal_rasterize to write different attribute values (columns) in different bands of one raster file.
I know that this I possible with gdal_rasterize using the -b and -burn flags. Anyway, I can’t manage to integrate this commands in my QGIS-Python script. Am I missing something with the syntax?
Here is the GDAL synopsis:
Usage: gdal_rasterize [-b band]* [-i] [-at]
{[-burn value]* | [-a attribute_name] | [-3d]} [-add]
[-l layername]* [-where expression] [-sql select_statement]
[-dialect dialect] [-of format] [-a_srs srs_def]
[-co "NAME=VALUE"]* [-a_nodata value] [-init value]*
[-te xmin ymin xmax ymax] [-tr xres yres] [-tap] [-ts width height]
[-ot {Byte/Int16/UInt16/UInt32/Int32/Float32/Float64/
CInt16/CInt32/CFloat32/CFloat64}] [-q]
<src_datasource> <dst_filename>
And here is my script so far:
##Rasterize_GDAL_KRK=name
##Input=vector
##Output=output raster
##Extent=extent
##cellsize=number 25
import os, processing, osgeo.gdal
processing.runalg('gdalogr:rasterize',
{"INPUT":Input,
"FIELD":"KRK_1",
"DIMENSIONS":1,
"WIDTH":cellsize,
"HEIGHT":cellsize,
"RAST_EXT":Extent,
"TFW":0,
"RTYPE":0,
"NO_DATA":None,
"COMPRESS":0,
"JPEGCOMPRESSION":1,
"ZLEVEL":1,
"PREDICTOR":1,
"TILED":False,
"BIGTIFF":3,
"EXTRA": None,
"OUTPUT":Output})