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. 69 guides in total.
16 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
- Regridding Explained: Bilinear, Conservative and Nearest for Gridded Data regridding explained conservative bilinear
- Site Suitability Explained: Constraints, Factors and Weights site suitability analysis gis
- Flow Direction Explained: D8, D-Infinity and MFD Compared d8 flow direction explained
- How DEM Resolution and Source Change a Drainage Network dem resolution stream network
- Bathymetry explained: depths, datums and grids bathymetry 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
- How to Select a Time Range and Location from an xarray Dataset xarray select time location
- How to Clip a NetCDF Grid to a Polygon in Python clip netcdf shapefile python
- How to Convert NetCDF to GeoTIFF in Python netcdf to geotiff python
- How to Extract a Time Series per Polygon from a NetCDF Grid netcdf zonal statistics polygons time series
- How to Redistribute Population with Dasymetric Mapping dasymetric mapping python
- How to Run a Weighted Site Suitability Analysis in Python suitability analysis python raster
- How to Condition a DEM for Hydrology: Breaching or Filling breach depressions dem python
- How to Calculate Flow Accumulation from a DEM in Python flow accumulation python
- How to Delineate a Watershed from a Pour Point in Python watershed delineation python
- How to Calculate Height Above Nearest Drainage (HAND) in Python hand python dem
- How to Burn a Known River Network into a DEM stream burning dem python
- How to embed provenance tags in a GeoTIFF geotiff metadata tags python
- How to estimate rooftop solar potential in Python rooftop solar potential python
- How to compute sky view factor from a surface model sky view factor python
- How to load and plot a bathymetry grid in Python load bathymetry python
- How to extract a coastline from a raster in Python extract coastline raster python
🔧 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
- Fixing a Suitability Map That Comes Out All One Value or All NoData suitability raster overlay nodata
- Fixing Flow Accumulation That Is All Zeros, NoData or Stops at the Edge flow accumulation nodata
- Bathymetry depths are positive in one file and negative in another bathymetry sign convention
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 → -
Gridded & Climate Data
A raster with a time axis, a calendar and forty years in one file.
Open path → -
Census & Demographics
The most-used open data there is, and the easiest to map wrongly.
Open path → -
Location & Accessibility
Who can reach what — and where the next site should go.
Open path → -
Hydrology & Watersheds
A DEM already knows where the water goes. Ask it carefully.
Open path → -
Metadata, Licensing & Provenance
A layer nobody can describe, cite or re-run is a layer nobody should use.
Open path → -
3D & Buildings
A footprint plus a height is not a building, but it is most of one.
Open path → -
Coastal & Marine
The shoreline is a choice of datum, not a line on a map.
Open path →
Related topics
Subjects that keep coming up alongside this one, most overlap first.