I'd like to know how to use the Python/GDAL function RasterizeLayer to create a raster layer, where each pixel give the maximum value of a integer attribute. According to docs and forums, if I use :
gdal.RasterizeLayer(out_raster_ds, # output to our new dataset
[1], # output to our new dataset's first band
layer, # rasterize this layer
None, None, # don't worry about transformations since we're in same projection
[0], # burn value 0
['ALL_TOUCHED=TRUE', # rasterize all pixels touched by polygons
'ATTRIBUTE=id'] # put raster values according to the 'id' field values
)
This will use the value of "id". But in my case, each raster cell intersects many spatial data (from PostGIS), and I want to keep the highest value.
Any idea ?