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. 45 guides in total.
9 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
- STAC Explained: How Satellite Imagery Catalogues Work stac explained
- Digital Elevation Models Explained: DEM, DSM and DTM dem dsm dtm explained
- Slope and Aspect Explained: How They Are Computed from a Grid slope aspect explained
- Cloud-Optimised GeoTIFF Explained: Tiles, Overviews and Range Requests cloud optimised geotiff explained
⚙️ 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
- How to Search and Download Satellite Imagery with STAC in Python download satellite imagery python
- How to Calculate Slope and Aspect from a DEM in Python calculate slope python dem
- How to Generate Contour Lines from a DEM in Python generate contours python
- How to Extract an Elevation Profile Along a Line in Python elevation profile python
- How to Fill Sinks and Derive Flow Direction from a DEM fill sinks flow direction python
- How to Calculate a Viewshed in Python viewshed python
- How to Load Sentinel-2 Bands into Python as an Analysis-Ready Array load sentinel2 bands python
- How to Resample Satellite Bands to a Common Grid resample satellite bands python
- How to Calculate NDVI from Sentinel-2 in Python calculate ndvi python
- How to Mask Clouds in Sentinel-2 Imagery with Python mask clouds sentinel2 python
- How to Build a Cloud-Free Composite from Many Satellite Scenes cloud free composite python
- How to Extract a Vegetation Index Time Series for a Polygon ndvi time series polygon python
- How to Detect Change Between Two Satellite Images in Python detect change satellite images python
- How to Rasterise a Point Cloud to a Grid in Python rasterise point cloud python
- How to Read a COG from a URL Without Downloading the Whole File read cog from url python
- How to Write a Cloud-Optimised GeoTIFF in Python write cloud optimised geotiff python
- How to Sample Training Points from Rasters and Polygons sample training points python
- How to Predict a Continuous Surface with Random Forest random forest spatial prediction python
- How to Turn Model Predictions Back into a Raster predictions to raster python
- How to Interpolate Points to a Grid with IDW in Python idw interpolation python
- How to Choose a Cell Size for an Interpolated Surface choose cell size interpolation
🔧 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
- Satellite Bands Have Different Shapes or Do Not Align satellite bands do not align
- NDVI Values Are Above 1 or Below −1: How to Fix It ndvi values out of range
- My Composite Has Holes, Stripes or Grey Patches composite has holes or stripes
- My Prediction Raster Is Striped, Blocky or Full of NoData prediction raster artefacts
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
-
Finding & Fetching Data
Get the data before you analyse it — from OSM, web services and satellite catalogues.
Open path → -
Terrain & Elevation
Turn a grid of heights into slope, shade, contours and drainage.
Open path → -
Raster Analysis
Read, reproject, clip and summarise raster data in Python.
Open path → -
Batch Processing
Process many files at once, reliably.
Open path → -
Satellite Imagery
From a scene on a catalogue to a number you can defend.
Open path → -
LiDAR & Point Clouds
Millions of points, and the surfaces worth deriving from them.
Open path → -
Cloud-Native GIS
Read the part you need, not the file it lives in.
Open path → -
Spatial Machine Learning
Why the usual rules break, and what to do instead.
Open path → -
Interpolation & Surfaces
A continuous surface from scattered samples, with its support attached.
Open path →
Related topics
Subjects that keep coming up alongside this one, most overlap first.