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:

  1. Start QGIS.
  2. From the Plugins menu, select Python Console.
  3. Run the gdalogr:merge algorithm, specifying the process name, two images, ...

Get QGIS Python Programming Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.