This lesson is still being designed and assembled (Pre-Alpha version)

Raster Calculations in Python

Overview

Teaching: 30 min
Exercises: 20 min
Questions
  • How do I subtract one raster from another and extract pixel values for defined locations?

Objectives
  • Perform a subtraction between two rasters using numpy.

  • Export raster data as a GeoTIFF file with rasterio.

FIXME

Key Points

  • Rasters can be computed on using mathematical functions.

  • Rasters can be read as numpy arrays, a fast data structure for matrix computations

  • The rasterio.io.Dataset.write() method can be used to write raster data to a file.