I've found two different ways for creating a multiband raster using python and qgis.
Both the methods produce the expected results. The dimension of the multiband raster file created with the first method is double of the dimension (in terms of byte) of the one produced with the first method.
Which method is preferable?
import os import processing # first method processing.runalg("gdalogr:merge", "/path/file1.tif;/path/file2.tif;/path/file3.tif", False, True, 0, 6, "/path/fileout.tif") # second method cmd = "gdal_merge.py -separate -o" + " path/outfile.tif " + " /path/file1.tif " + " /path/file2.tif " + " /path/file3.tif" os.system(cmd)