I am trying to merge two rasters (geotiffs) in QGIS.
One raster is the original & the other is clipped to a specific region of the original raster and 0 applied to null area to make transparent. See pictures below.
Original:
clipped:
Both together, clipped on top:
I want to merge the clipped raster on top of the original raster to make one file where the original raster is visible in the null (transparent) area of the clipped raster.
Depending on the order I list the files in the gdal command generated by merge function in QGIS I get a merge result where you cannot see the clipped raster or I get a merge result where the original raster is not visible in the null area of the clipped raster.
What do I need to do to have the clipped raster merge on top of the original raster and be able to see the original raster in the null area of the clipped raster?
Some of the questions I have looked through that seemed related:
Which value does raster merge chose in overlapping area?
How to merge two or more rasters which overlap?
Per request of 1st responder here is the gdal merge command generated in qgis:
gdal_merge.py -n 0 -a_nodata 0 -of GTiff -o /home/qgis/Desktop/merge1.tif /home/qgis/Desktop/41_36_1.tif /home/qgis/Desktop/41_36_2.tif
I have tried with the files in both orders.
Here's a link to download the files I am working on.
https://drive.google.com/open?id=17wyRKbkDE1twWBSMDsY2upY7cuoHmOq1





gdalwarp clipped.tif original.tif. But there might be an option to improve the automatically generated gdal command to handle nodata correctly if you add the command into your question. – user30184 May 02 '19 at 18:06Mosaicing into an existing output file is supported if the output file already exists.– user30184 May 02 '19 at 20:34