In python, I'm using the following line of code:
gdal.RasterizeLayer(outDs, [1], Shp, burn_values=[ii])
My shapefile 'Shp' has a field named 'landuse', which stores strings (class name). I need to burn a number for different class name. I was thinking to use a "where" clause, like: where 'landuse'='new concession':
for ii in range(class)):
gdal.RasterizeLayer(outDs, [1], Shp, burn_values=[ii], where='"landuse"="class[ii]"')
Parameter "where" does not seem to be recognized. How can I pass it to this function? I suppose it is available, according to the C API doc: http://gdal.org/python/osgeo.gdal-module.html#RasterizeOptions