CNCAPResearch & Education

Home / Education / Python for Geospatial Science

GIS Application · Programme 03

Python for Geospatial Science

Scientific programming, spatial data engineering, modelling and reproducible workflows.

60Planned tutorials
8Learning series
3Difficulty levels

Practical exercises

Search by title, method, software, tutorial ID or research theme. Expand a series to view each planned lesson.

Programme requirements: Python 3; isolated environment; Jupyter or an IDE; package versions to be pinned for released lessons.
All tutorials are planned. Exact versions, datasets and entitlement checks will accompany released lessons. Open educational materials do not imply free access to all software.

60 of 60 tutorials

Series A · Python Programming Fundamentals (8)
  1. Installing Python and managing environments

    Beginner · Planned

    Learning objective: Create and activate a reproducible Conda or venv environment.

    Software and inputs: Python; JupyterLab

  2. Variables, data types and operators

    Beginner · Planned

    Learning objective: Represent coordinates, measurements and categorical attributes in Python.

    Software and inputs: Python; JupyterLab

  3. Lists, dictionaries and iteration

    Beginner · Planned

    Learning objective: Loop over station records and build a structured summary.

    Software and inputs: Python; JupyterLab

  4. Functions and reusable modules

    Beginner · Planned

    Learning objective: Write a function that validates inputs and returns a calculated indicator.

    Software and inputs: Python; JupyterLab

  5. Reading and writing files with pathlib

    Beginner · Planned

    Learning objective: Construct portable paths and read and write text files.

    Software and inputs: Python; JupyterLab

  6. Tabular analysis with pandas

    Beginner · Planned

    Learning objective: Clean missing values, merge tables and aggregate observations.

    Software and inputs: Python; JupyterLab; pandas

  7. Numerical arrays with NumPy

    Beginner · Planned

    Learning objective: Apply vectorised calculations and masked array operations.

    Software and inputs: Python; JupyterLab; NumPy

  8. Debugging and testing scientific code

    Beginner · Planned

    Learning objective: Trace exceptions and write tests for known numerical cases.

    Software and inputs: Python; JupyterLab; pytest

Series B · Vector Data Processing with GeoPandas and Shapely (8)
  1. Reading vector data and inspecting CRS

    Intermediate · Planned

    Learning objective: Load GeoPackage and GeoJSON datasets and inspect geometry metadata.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  2. Creating point geometries from survey tables

    Intermediate · Planned

    Learning objective: Convert longitude and latitude to correctly referenced points.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  3. Reprojecting spatial datasets

    Intermediate · Planned

    Learning objective: Transform coordinates and choose a suitable projected CRS.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  4. Geometry repair and validity checks

    Intermediate · Planned

    Learning objective: Identify invalid polygons and assess changes after repair.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  5. Vector buffers and overlay

    Intermediate · Planned

    Learning objective: Construct buffers and calculate intersection areas.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  6. Spatial joins and nearest neighbours

    Intermediate · Planned

    Learning objective: Link features by containment or nearest distance and validate joins.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  7. Spatial aggregation and dissolve

    Intermediate · Planned

    Learning objective: Aggregate attributes by geographic unit and merge shared boundaries.

    Software and inputs: Python; GeoPandas; Shapely; pyproj

  8. Exporting interoperable vector datasets

    Intermediate · Planned

    Learning objective: Write GeoPackage and GeoParquet files with documented CRS and schema.

    Software and inputs: Python; GeoPandas; Shapely; pyproj; pyarrow

Series C · Raster Processing with GDAL and Rasterio (8)
  1. Inspecting raster metadata and transforms

    Intermediate · Planned

    Learning objective: Read raster dimensions, nodata, CRS and affine transforms.

    Software and inputs: Python; GDAL; Rasterio; NumPy

  2. Reading and writing multiband GeoTIFFs

    Intermediate · Planned

    Learning objective: Build a multiband file while preserving georeferencing.

    Software and inputs: Python; GDAL; Rasterio; NumPy

  3. Raster clipping and masks

    Intermediate · Planned

    Learning objective: Clip imagery with vector boundaries and distinguish nodata from zero.

    Software and inputs: Python; GDAL; Rasterio; NumPy; GeoPandas

  4. Reprojecting and resampling rasters

    Intermediate · Planned

    Learning objective: Align rasters to a common grid using appropriate resampling methods.

    Software and inputs: Python; GDAL; Rasterio; NumPy

  5. Mosaicking overlapping raster tiles

    Intermediate · Planned

    Learning objective: Merge tiles and inspect seam and nodata behaviour.

    Software and inputs: Python; GDAL; Rasterio; NumPy

  6. Calculating spectral indices with arrays

    Intermediate · Planned

    Learning objective: Compute vegetation and water indices with safe division and masks.

    Software and inputs: Python; GDAL; Rasterio; NumPy

  7. Zonal statistics and raster-vector sampling

    Intermediate · Planned

    Learning objective: Summarise pixel values by polygons and compare boundary handling.

    Software and inputs: Python; GDAL; Rasterio; NumPy; rasterstats; GeoPandas

  8. Windowed processing and cloud-optimised GeoTIFFs

    Advanced · Planned

    Learning objective: Process raster blocks and write tiled outputs with overviews.

    Software and inputs: Python; GDAL; Rasterio; NumPy

Series D · Multidimensional Data with Xarray and NetCDF (6)
  1. Opening NetCDF climate datasets

    Intermediate · Planned

    Learning objective: Inspect dimensions, coordinates, attributes and time conventions.

    Software and inputs: Python; Xarray; netCDF4; NumPy

  2. Selecting and aggregating multidimensional data

    Intermediate · Planned

    Learning objective: Subset spatial and temporal dimensions and calculate seasonal means.

    Software and inputs: Python; Xarray; netCDF4; NumPy

  3. Handling CF metadata and calendar types

    Intermediate · Planned

    Learning objective: Interpret units and calendars and avoid invalid temporal conversions.

    Software and inputs: Python; Xarray; netCDF4; NumPy

  4. Regridding gridded observations

    Intermediate · Planned

    Learning objective: Compare interpolation methods and verify coordinate alignment.

    Software and inputs: Python; Xarray; netCDF4; NumPy; rioxarray; xESMF

  5. Combining files into a data cube

    Intermediate · Planned

    Learning objective: Concatenate consistent datasets and handle duplicate timestamps.

    Software and inputs: Python; Xarray; netCDF4; NumPy; Dask

  6. Storing chunked arrays with Zarr

    Advanced · Planned

    Learning objective: Choose chunks for efficient access and write an analysis-ready store.

    Software and inputs: Python; Xarray; netCDF4; NumPy; Zarr; Dask

Series E · Spatial Statistics and Spatial Regression (8)
  1. Constructing spatial weights

    Intermediate · Planned

    Learning objective: Compare contiguity, distance and nearest-neighbour weights.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg

  2. Global spatial autocorrelation with PySAL

    Advanced · Planned

    Learning objective: Estimate Moran’s I and interpret permutation significance.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg

  3. Local indicators of spatial association

    Advanced · Planned

    Learning objective: Map local clusters and consider multiple-testing implications.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg

  4. Variograms and spatial interpolation

    Advanced · Planned

    Learning objective: Fit variogram models and compare kriging against held-out values.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg; PyKrige; SciPy

  5. Ordinary least squares and diagnostics

    Advanced · Planned

    Learning objective: Fit a baseline regression and inspect residual autocorrelation.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg; statsmodels

  6. Spatial lag and spatial error models

    Advanced · Planned

    Learning objective: Compare model assumptions and residual dependence.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg

  7. Geographically weighted regression in Python

    Advanced · Planned

    Learning objective: Estimate spatially varying relationships and evaluate local diagnostics.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg; mgwr

  8. Multiscale geographically weighted regression in Python

    Advanced · Planned

    Learning objective: Estimate predictor-specific bandwidths and interpret local coefficients.

    Software and inputs: Python; GeoPandas; libpysal; esda; spreg; mgwr

Series F · Environmental Time-Series Analysis (8)
  1. Time-series cleaning and temporal aggregation

    Intermediate · Planned

    Learning objective: Identify duplicates, missing intervals and inconsistent time units.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels

  2. Seasonal decomposition and smoothing

    Intermediate · Planned

    Learning objective: Separate trend and seasonality and compare smoothing settings.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels

  3. Anomaly calculation and baseline selection

    Intermediate · Planned

    Learning objective: Calculate seasonal anomalies relative to a documented reference period.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels

  4. Theil–Sen slope and trend uncertainty

    Intermediate · Planned

    Learning objective: Estimate robust trend magnitude and confidence intervals.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels

  5. Mann–Kendall and seasonal trend tests

    Intermediate · Planned

    Learning objective: Apply trend tests and consider serial dependence.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels; pymannkendall

  6. Change point detection in environmental records

    Advanced · Planned

    Learning objective: Identify candidate structural breaks and evaluate false positives.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels; ruptures

  7. Time-series forecasting with held-out periods

    Advanced · Planned

    Learning objective: Compare baseline and statistical forecasts using rolling-origin tests.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels

  8. Pixel-wise trends in satellite data cubes

    Advanced · Planned

    Learning objective: Apply trend functions across pixels with observation-count masks.

    Software and inputs: Python; pandas; NumPy; SciPy; statsmodels; Xarray; Dask

Series G · Scientific Visualisation and Cartography (6)
  1. Exploratory plots for geospatial datasets

    Intermediate · Planned

    Learning objective: Plot distributions and identify outliers before mapping.

    Software and inputs: Python; Matplotlib; GeoPandas; pandas

  2. Creating choropleth maps

    Intermediate · Planned

    Learning objective: Compare classification schemes and colour choices for rates and counts.

    Software and inputs: Python; Matplotlib; GeoPandas; mapclassify

  3. Mapping continuous raster surfaces

    Intermediate · Planned

    Learning objective: Display rasters with meaningful colour scales and units.

    Software and inputs: Python; Matplotlib; GeoPandas; Rasterio

  4. Publication-quality multi-panel figures

    Intermediate · Planned

    Learning objective: Arrange consistent map panels with legends and scale information.

    Software and inputs: Python; Matplotlib; GeoPandas

  5. Interactive maps with Folium

    Intermediate · Planned

    Learning objective: Publish a lightweight map with layer controls and accessible popups.

    Software and inputs: Python; Matplotlib; GeoPandas; Folium

  6. Visualising temporal trajectories and uncertainty

    Intermediate · Planned

    Learning objective: Plot time series with confidence intervals and missing-observation gaps.

    Software and inputs: Python; Matplotlib; GeoPandas; pandas; NumPy

Series H · Automation and High-Performance Computing (8)
  1. Building a parameterised command-line GIS script

    Advanced · Planned

    Learning objective: Expose inputs, outputs and options through a command-line interface.

    Software and inputs: Python; pathlib; logging; pytest; argparse

  2. Batch processing and structured logging

    Advanced · Planned

    Learning objective: Process directories with restartable logs and explicit error handling.

    Software and inputs: Python; pathlib; logging; pytest

  3. Parallel vector and raster tasks

    Advanced · Planned

    Learning objective: Compare serial and process-based execution with safe file outputs.

    Software and inputs: Python; pathlib; logging; pytest; concurrent.futures; GeoPandas; Rasterio

  4. Chunked raster analysis with Dask

    Advanced · Planned

    Learning objective: Choose chunk sizes and measure memory and runtime costs.

    Software and inputs: Python; pathlib; logging; pytest; Dask; Xarray

  5. Running geospatial jobs on HPC clusters

    Advanced · Planned

    Learning objective: Write a scheduler job and manage resources and environment activation.

    Software and inputs: Python; pathlib; logging; pytest; HPC access; Slurm or site scheduler

  6. Packaging reusable geospatial functions

    Advanced · Planned

    Learning objective: Build a package with tests, version metadata and documentation.

    Software and inputs: Python; pathlib; logging; pytest; build; pytest

  7. Workflow orchestration with Snakemake

    Advanced · Planned

    Learning objective: Express file dependencies and rerun only outdated targets.

    Software and inputs: Python; pathlib; logging; pytest; Snakemake

  8. Reproducible research release and benchmarking

    Advanced · Planned

    Learning objective: Archive environments, parameters, test data and runtime comparisons.

    Software and inputs: Python; pathlib; logging; pytest; Git; environment lockfile tools

Learning resources

Practical guidelines, videos, teaching datasets and source code will be linked here as they become available. Data redistribution and software licensing conditions will be respected.