O'Reilly logo

QGIS Python Programming Cookbook by Joel Lawhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating raster footprints

A common way to catalog raster datasets that consist of a large number of files is by creating a vector dataset with polygon footprints of the extent of each raster file. The vector footprint files can be easily loaded in QGIS or served over the Web. This recipe demonstrates a method to create a footprint vector from a directory full of raster files. We will build this program as a Processing Toolbox script, which is easier to build than a QGIS plugin and provides both a GUI and a clean programming API.

Getting ready

Download the sample raster image scenes from https://geospatialpython.googlecode.com/svn/scenes.zip. Unzip the scenes directory into a directory named rasters in your qgis_data directory.

For this recipe, we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required