Book Image

QGIS Python Programming Cookbook

Book Image

QGIS Python Programming Cookbook

Overview of this book

Table of Contents (16 chapters)
QGIS Python Programming Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 will create a new Processing Toolbox script using the following steps:

  1. In the QGIS Processing Toolbox, expand the Scripts tree menu.

  2. Next, expand the Tools tree menu.

  3. Finally, double-click on the Create new script item to bring up the processing script...