Raster & rasterio
Reading, sampling and converting raster data in Python.
Everything on Spatial Workflow about raster & rasterio, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 16 guides in total.
2 learning paths run through this topic — follow one if you would rather work through a route than pick a single guide.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- Vector vs Raster Data in Python GIS: Key Differences vector raster data python gis
- Introduction to Rasterio: Reading Raster Data in Python rasterio python tutorial
- The Raster Data Model Explained: Bands, dtype, NoData and the Transform raster data model python
- Raster Resampling Explained: Nearest, Bilinear and When Each Is Wrong raster resampling methods
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Extract Raster Values at Point Locations with Rasterio extract raster values rasterio
- How to Convert a Raster to a Vector in Python raster to vector python
- How to Batch Process Rasters with Rasterio in Python batch process rasters rasterio python
- How to Reproject a Raster in Python with Rasterio reproject raster rasterio
- How to Clip a Raster to a Polygon in Python clip raster to polygon python
- How to Calculate Zonal Statistics in Python zonal statistics python
- How to Rasterize a Vector Layer in Python rasterize vector python
- How to Merge and Mosaic Rasters in Python with Rasterio merge rasters rasterio mosaic
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- RasterioIOError: Not Recognized as a Supported File Format (How to Fix) rasterioioerror supported file format
- Rasterio Returns the Wrong Values: NoData, Scaling and dtype Fixes rasterio nodata wrong values
- Raster and Vector Do Not Line Up in Python: How to Fix It raster vector not aligned python
- Rasterio Output GeoTIFF Is Black or Empty: How to Fix It rasterio output black empty
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.