Skip to content

Examples — "How do I…?"#

A task-oriented index of the runnable example notebooks. Find the operation you need, open the notebook. Every notebook runs offline on the repository's test data.

Read, write & convert#

I want to… Notebook
Open a raster and read values Dataset basics
Convert GeoTIFF ↔ NetCDF (incl. bands ↔ variables) GeoTIFF ↔ NetCDF
Convert between raster formats (ASCII / COG / Zarr) Other raster formats
Convert between vector formats (SHP / GPKG / GeoParquet) Vector formats
Read only part of a raster (window / tile / bbox) Windowed & tiled reads

Transform & align#

I want to… Notebook
Reproject, resample, or align to a reference grid Reproject, resample & align
Crop / mask to a polygon or bounding box Crop & mask
Mosaic tiles or stack bands into one raster Mosaic & merge
Handle no-data and fill gaps No-data & gap filling

Analyse#

I want to… Notebook
Compute zonal statistics per polygon Zonal statistics
Sample / extract raster values at points Extract at points
Derive slope / aspect / hillshade from a DEM Terrain analysis
Do raster algebra (apply / map_blocks / overlay) Raster algebra

Vector & raster–vector#

I want to… Notebook
Rasterize a vector / vectorize a raster Rasterize ↔ vectorize
Build & reshape vector geometry Vector geometry toolkit

Visualize#

I want to… Notebook
Render a raster (image / plot / histogram) Visualization gallery
Read & write colour tables / band colours Color tables & band colors
Build overviews (image pyramids) Overviews

Scale out (lazy / Dask)#

I want to… Notebook
Use pyramids with Dask — overview Using pyramids with Dask
Lazy raster / collection / vector / NetCDF Dataset · Collection · Feature · NetCDF

Cloud & catalogs#

I want to… Notebook
Read Cloud Optimized GeoTIFFs COG basics
Search & load a STAC catalog STAC (local)
Work with Zarr stores Zarr basics