1

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.

1
  • 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
    Commented Jul 19, 2017 at 11:28

1 Answer 1

5
  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):

    ("base@1"=0)*"filler@1"+("base@1"!=0)*"base@1"
    

    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.