Raster processing using Python Tools: Reference

Key Points

Setup Tutorial Python Environment
  • It’s best practice to create a unique conda environment for each of your projects. Here we install a raster environment called ‘rasterenv’.

Introduction to Raster Data
  • Raster data is pixelated data where each pixel is associated with a specific location.

  • Raster data always has an extent and a resolution.

  • The extent is the geographical area covered by a raster.

  • The resolution is the area covered by each pixel of a raster.

Raster Formats and Libraries
  • Geospatial libraries such as GDAL are very useful for reading, writing and transforming rasters

  • Once a raster’s pixel values have been extracted to a NumPy array, they can be processed with more specialized libraries and routines.

Working with Raster Datasets
  • Rasterio is built around the GDAL library (recall section 3), to facilitate raster operations in Python.

  • Pixel values of rasters can be extracted to a numpy array.

  • Computation is done in local memory on numpy arrays, then saved to the raster format of choice.

Rainier DEM Example
  • pygeotools provides functions built on GDAL to simplify many raster warping tasks

  • Raster analysis in Python revolves around NumPy arrays as the primary data structure and programming model

FIXME: more reference material.