Creating raster footprints
A common way to catalog the 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://github.com/GeospatialPython/Learn/raw/master/scenes.zip. Unzip the scenes
directory into a directory named rasters
in your qgis_data
directory.
For this ...
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.