-
Book Overview & Buying
-
Table Of Contents
QGIS Python Programming Cookbook
By :
Pyramids, or overview images, sacrifice the disk space for map rendering speed by storing resampled, lower-resolution versions of images in the file alongside the full resolution image. Once you have finalized a raster, building pyramid overviews is a good idea.
For this recipe, we will use a false-color image, that you can download from https://geospatialpython.googlecode.com/files/FalseColor.zip.
Unzip this TIF file and place it in your /qgis_data/rasters directory.
The Processing Toolbox has a dedicated algorithm for building pyramid images. Perform the following steps to create pyramids for a raster
Start QGIS.
From the Plugins menu, select Python Console.
Import the processing module:
import processing
Run the gdalogr:overviews algorithm, specifying the process name, input image, overview levels, the option to remove existing overviews, resampling method (0 is the nearest neighbor), and overview format (1 is internal):
processing.runalg...
Change the font size
Change margin width
Change background colour