This question already has an answer here:

I have a 50cm Digital Terrain Model (tiff) with some nodata values. Instead of interpolating them, I would like to fill them in with values from a lower resolution (1m) DTM of the same area. I think this can be achieved using the raster calculator, but can't for the life of me work it out.

I'm working in QGIS 2.18.

marked as duplicate by ahmadhanb, mgri, John Powell, whyzar, Mapperz Jul 19 '17 at 14:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 3
    The linked question does not appear to be a dupe of this. It asks about converting 0 to NoData. This question asks how to replace NoData values with values from a different raster. – user2856 Jul 19 '17 at 11:28
  1. Change "nodata" value of your base (50cm DTM) raster to some unused value (for example 0 or -9999) with gdal_translate Raster --> Conversion --> Translate (Convert format). See mentioned question Redefining nodata value into zero in QGIS?.

  2. Then in raster calculator use this expression (for nodata value 0):


    This will go through rasters and do: if pixel value in base raster is 0 take value from filler raster, if pixel value in base raster is not 0 keep value (exactly take value from base raster again)

Not the answer you're looking for? Browse other questions tagged or ask your own question.