I'm writing a QGIS plugin and I need to create a raster layer as the average of other rasters. How can I do it? I have tried to use gdal_calc.py through os.system, something like:
cmd = 'gdal_calc.py -A first_layer.tif -B second_layer.tif --outfile=AVG.tif --cal="(A+B)/2"'os.system(cmd)but it seems that the command (which works perfectly fine in the command line) is not executed from my QGIS plugin. What should I use to create my average raster?
Many thanks for your help
أكثر...
cmd = 'gdal_calc.py -A first_layer.tif -B second_layer.tif --outfile=AVG.tif --cal="(A+B)/2"'os.system(cmd)but it seems that the command (which works perfectly fine in the command line) is not executed from my QGIS plugin. What should I use to create my average raster?
Many thanks for your help
أكثر...