I have a raster representing rivers/drainage basins within a terrain:
I have a raster DEM of the terrain:
In the basin raster, everything in black is 9999. White is nodata.
The DEM is obviously a range of values, from 1-500.
I want to combine these two rasters, in either of two ways: The drainage raster has its values added to those of the DEM. So if the course of the drainage basin in the DEM is originally a range of values between 2-300, the new range would be between 10199-10299.
Or: The drainage raster has its values replace those of the DEM. So if the course of the drainage basin in the DEM is originally a range of values between 2-300, it would now be a static 9999.
This seems like it should be straightforward, but I can't come up with a method in raster calc to give me the desired output. The closest I've come is an output raster which adds the two values together, but all of the surrounding DEM data is missing. i.e., the output looks identical to the basin raster, but with the combined value of DEM + basin raster.
I found the following solution from about a year ago: Updating/replacing raster values in one raster values from another in QGIS?
However, I can't replicate this behaviour in QGIS 3.4. When attempting to point the vectorization output at the existing DEM, it does not update, my ultimate output is the same DEM i began with.
My goal is to be able to run r.drain on the resulting map and get paths that do not follow the drainage basins, but instead find the next most efficient path through the terrain.
If someone knows of a better method to achieve this result, I'd welcome that as well. My DEM is based on vector contours/breaklines/point data, and I considered trying to re-interpolate the DEM based on the original vector drainage map, but wasn't able to come up with a way to do that either.