I have been using QGIS Raster Calculator
to patch Raster Bs values in where Raster As are 0 using the below expression
("A@1" = 0) * "B@1" + ("A@1" != 0) * "A@1"
I now want to do this using gdal_calc
within a python script, but it keeps throwing up the error that my formula is an invalid syntax. How can I achieve the same results?
gdal_calc --calc "(A = 0) * B + (A != 0) * A" --format GTiff --type Float32 -A C:\Users\Public\try\A.tif --A_band 1 -B C:\Users\Public\try\B.tif --B_band 1 --outfile C:/Users/public/OUTPUT.tif