One of the most powerful aspects of PostGIS is its ability to use geometry and rasters in tandem. This chapter focuses on the use of raster aggregate functions, functions to manipulate rasters down to the pixel level, and functions for deriving additional rasters and geometries. You’ll also learn about built-in summary statistic functions that you can use to explore the distribution of pixel values. You’ll learn how to use geometry to isolate pixel values of interest.
For many of the examples in this chapter, we used climate data from WorldClim (www.worldclim.org/data/worldclim21.html). We downloaded elevation, precipitation, and average temperature raster monthly data divided into 10 minute degree intervals and covering 1970–2000. The data came packaged as .tif files. Elevation is in meters, precipitation in millimeters, and temperature in degrees Celsius. We also made an occasional excursion to Kauai, Hawaii, for which we downloaded elevation data (http://gis.ess.washington.edu/data/raster/tenmeter/hawaii/index.html).
You can download all the code and some of the data for this chapter at www.postgis.us/chapter_12_edition_3. The WorldClim data has redistribution restrictions, so it’s not included in the download.