Chapter 12. Raster processing
This chapter covers
- Loading raster data
- Spatial aggregate raster functions
- Using geometries to clip rasters
- Accessing pixel values and isolating bands
- Retiling rasters
- Raster statistical functions
- Map algebra functions
In this chapter, we’ll focus on the use of raster aggregate functions, functions to manipulate rasters down to the pixel level, and functions for deriving additional rasters and geometries. We’ll also demonstrate built-in summary statistics functions that you can use to learn more about the distribution of pixel values. You’ll see in the examples that we consistently use geometry to isolate pixel values of interest. Being able to use geometry and raster in tandem is a powerful aspect of PostGIS.
For this chapter, our discussion presumes that you have PostGIS 2.1 or higher. Although we do highlight salient changes between 2.0 and 2.1, we strongly encourage you to upgrade to PostGIS 2.1 (if you haven’t already done so) so you can take advantage of the latest functions for rasters. As an added bonus, you’ll luxuriate in significant speed gains for some of the most taxing functions.