I have two rasters: Raster A and B. Raster A has has only values of 0. The white area in Raster B are No Data values. I want to merge them to one raster (Raster C). So basically I want all pixels in Raster B with a No Data value to have a value of 0.
I tried to do this with the raster calculator in QGIS by adding Raster A to Raster B, but it only returns again Raster B.
I am looking for solutions with QGIS, GDAL, or Grass GIS.
Best Answer
One solution may be this batch script:
The trick is
-srcnodata None
offered bygdalwarp
, which is very useful in order to ignore intrinsic nodata settings on the source dataset (from the doc). In detail, we need to apply it two times: firstly because we need to substitute the NoData value with 0 and so we have to include it in the calculation, secondly becausegdal_calc.py
introduces NoData value again.