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

Intro to Raster Data in Python

Overview

Teaching: 40 min
Exercises: 20 min
Questions
  • What is a raster dataset?

  • How do I work with and plot raster data in Python?

  • How can I handle missing or bad data values for a raster?

Objectives
  • Describe the fundamental attributes of a raster dataset.

  • Explore raster attributes and metadata using Python.

  • Read rasters into Python using the rasterio package.

  • Plot a raster file in Python using the earthpy package.

  • Describe the difference between single- and multi-band rasters.

FIXME

Key Points

  • The GeoTIFF file format includes metadata about the raster data.

  • To plot raster data with the earthpy package, we need to read in the image as a numpy array.

  • rasterio stores CRS information in the PROJ4 dict format.

  • Be careful when dealing with missing or bad data values.