Sunday 2 February 2020

gdal - create a maximum raster using gdal_calc


I have an NDVI-Time series (24 tiffs from one year). What I would like to calculate is one single Raster with the Maximum NDVI-value for each pixel from all 24 images. I thought about using gdalcalc but I cannot find the right syntax to calculate the maximum of a my inputfiles:


Example for 2 Layers:


shell("E:/Programme/OSGeo4W.bat; gdal_calc -A E:/IVFL/Somalia/NDVI/201401_001_NDVI_NAfill.tif -B E:/IVFL/Somalia/NDVI/201409_121_NDVI_NAfill.tif --outfile E:/IVFL/Somalia/NDVI_maximum.tif --calc=(max(A,B))")

calc=max(A,B) always gives me an error.


And in the end I even have 24 input files and not only 2. Does anyone know the syntax (numpy) to calculate the maximum?



Answer



you must use maximum instead of max


--calc="maximum(A,B)"

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...