[GIS] Adding DEM Band to existing 3-band TIFF file using QGIS

gdalgeotiff-tiffmulti-bandqgis

I'm quite new in the GIS business and I do not figure out how to do the following thing:

I have two geoTIFF Files, one is a 3+1 bands file (RGB+alpha), the second one is a DEM geoTIFF file containing one band with elevation data.

For a certain application, what I need is a 1+3+1 bands geoTIFF, containing the elevation Data on the first band, and the optical data plus the alpha info in the 2nd to 4th bands.

How can I join or add bands from different geoTIFF's using QGIS, for instance?

I have found a similar question as Adding band to existing GeoTiff using GDAL?, but there does not seem to exist a definitive answer there.

Best Answer

Use

gdalbuildvrt fiveband.vrt -separate dem.tif threebandalpha.tif
gdal_translate fiveband.vrt fiveband.tif

If you application uses GDAL, you can just open the vrt.