I have two DEMS. One is a 10m DEM (let's call it DEM-A) covering a large area (projection EPSG 4326). The other is a higher resolution DEM (DEM-B) that was constructed from a structure-from-motion point cloud, but has since been down-sampled to 10m and projected into the same coordinate system (EPSG 4326). I need to replace the values in DEM-A with the values in DEM-B where there are such, and keep all values of DEM-A where there there is nothing (i.e. nodata in DEM-B or no coverage of DEM-B).
In the image below, you can see parts of DEM-A on the right, and parts of DEM-B on the left. Black cells are nodata (-9999). You can see that the grids don't quite match, so DEM-B will need to be resampled to fit the grid in DEM-A.
I feel like this should be a straigthforward conditional statement, but I can't get it to work. Happy to get suggestions for QGIS, gdal, or anything open source.