Mosaicing rasters
Mosaicing rasters is the process of fusing multiple geospatial images with the same resolution and map projection into one raster. In this recipe, we'll combine two overlapping satellite images into a single dataset.
Getting ready
You will need to download the overlapping dataset from https://github.com/GeospatialPython/Learn/raw/master/overlap.zip if you haven't downloaded it from a previous recipe.
Place the two images in your /qgis_data/rasters/
directory.
How to do it...
This process is relatively straightforward and has a dedicated algorithm within the Processing Toolbox. Perform the following steps:
Start QGIS.
From the Plugins menu, select Python Console.
Run the
gdalogr:merge
algorithm, specifying the process name, two images, a boolean to use the pseudocolor palette from the first image, a boolean to stack each image into a separate band, and the output filename:processing.runalg("gdalogr:merge", "/qgis_data/rasters/Image2.tif; ...