I try to use gdal.BuildVRT in Python Script to calculate the maximum cell value for several overlapping raster. I know that I could use gdal.BuildVR from the QGIS library like this:
processing.run("gdal:buildvirtualraster", {
'INPUT':list_c,
'RESOLUTION':0,
'SEPARATE':False,
'PROJ_DIFFERENCE':False,
'ADD_ALPHA':False,
'ASSIGN_CRS':EPSG,
'RESAMPLING':None,
'SRC_NODATA':'255',
'EXTRA':'',
'OUTPUT':my_output_path})
but this doesn’t allow me to calculate the maximum value. I found this solution
but I cant make it work:
vrt_options = gdal.BuildVRTOptions(resampleAlg='max', addAlpha=False)
my_output_pat = path_to_my_output + '/' + 'output.vrt'
KRK_agg = gdal.BuildVRT(my_output_pat, list_c, options=vrt_options)
KRK_agg.FlushCache()
Any solutions?