07: Raster 2 - Reprojection, Clipping, Sampling, Zonal Stats
Contents
07: Raster 2 - Reprojection, Clipping, Sampling, Zonal Stats#
UW Geospatial Data Analysis
CEE467/CEWA567
David Shean
Overview#
This week, we are going to revisit rasters. We will cover common operations and strategies, including reprojection, clipping, sampling, zonal statistics, and creating rasters from unstructured point data.
Reading and Tutorials#
Please take some time to review the following material (especially if you have limited GIS experience), and come with questions on topics that are unclear, so we can discuss together. There is some overlap in content, but different presentation of the essential material, so hopefully one or more will work for you:
rioxarray#
We will dive into xarray
in a few weeks, but we will introduce some raster processing and analysis concepts using rioxarray
this week. It will be useful to have a general understanding of these two packages from the high-level “quick overview” docs:
Raster Reprojection#
rasterio: https://rasterio.readthedocs.io/en/latest/topics/reproject.html
rioxarray: https://corteva.github.io/rioxarray/stable/examples/reproject.html (much closer to the geopandas
to_crs()
method)reproject_match: https://corteva.github.io/rioxarray/stable/examples/reproject_match.html (very useful for comparing two rasters)
Raster clipping/masking#
Raster resampling/interpolation#
Sampling a raster over polygon areas: zonal statistics#
Sampling a raster at points#
Gridding points to raster#
We will revisit point interpolation and gridding in Lab08
Useful examples of basic raster processing#
-
Nice examples of raster reprojection, clipping, subtraction and export