Skip to content

About

Geologic and surface-change mapping from satellite images and DEMs.

Resources

Stars

54 stars

Watchers

2 watching

Forks

Repository files navigation

pyGeoMapper

DOI License
Python versions PyPI version PyPI downloads conda-forge version conda downloads

pyGeoMapper

Warning

pyGeoMapper is under active development, and many functions are still experimental and not fully validated. Please use with caution.

pyGeoMapper maps what changed on the ground, and what it's made of, using satellite images and elevation models (DEMs). I wanted one place to go from raw rasters to something a geologist can actually read: change maps after a landslide, flood, wildfire, earthquake, volcano or glacier event, unit maps scored against a real geologic map, and cross-sections and 3D block diagrams you can open in a browser. It's Python with a Rust core. (Not related to The-Magicians-Code/PyGeoMapper.)

Data types

pyGeoMapper can read, analyze, and visualize:

  • Elevation: DEMs and lidar (Copernicus GLO-30, USGS 3DEP lidar); terrain derivatives, CWT complexity, DEM of Difference
  • Optical imagery: multispectral Sentinel-2 and Landsat, NAIP aerial RGB; spectral indices (NDVI, NBR, NDWI, BSI, clay and iron ratios) and their change; optical feature-tracking velocity
  • Satellite embeddings: 64-band Google AlphaEarth annual embeddings for classification and embedding change
  • InSAR: Sentinel-1 LiCSAR displacement, offsets, and wrapped phase; UAVSAR unwrapped phase to LOS; Okada fault models
  • Ice velocity: NASA ITS_LIVE velocity grids and speed change
  • Geology: geologic map polygons as training and validation labels, bed attitudes (strike/dip), and fault traces for cross-sections and 3D block models

Installation

pip install pygeomapper

or from conda-forge repository with conda:

conda install pygeomapper
# from source (Python 3.10+, Rust 1.75+):
git clone https://github.com/GeoLarryLai/pyGeoMapper.git && cd pyGeoMapper
pip install maturin && maturin develop --release

pip install pygeomapper includes the forge3d 3D terrain renderer. If the renderer is missing, run pip install forge3d; otherwise viewer_3d falls back to its built-in renderer automatically.

Citation

Lai, L.S.-H. (2026) pyGeoMapper. Zenodo, https://doi.org/10.5281/zenodo.23832020

Methods: Horn (1981), Zevenbergen & Thorne (1987), Nuth & Kääb (2011), Montero et al. (2023), Lai et al. (2025), Brown et al. (2025), Okada (1985), Staley et al. (2017), Horton et al. (2017). Data sources: example_data/SOURCES.txt, NOTICE.

What it can do

  • Map terrain and surface features: spectral indices plus slope, curvature, roughness, and multiscale CWT complexity
  • Make supervised geologic unit maps from AlphaEarth embeddings and other features, scored against a geologic map
  • Reconstruct those maps as cross-sections and 3D geologic models you can open in a browser
  • Detect surface change at different temporal and spatial scales: DEM of Difference, spectral change, and InSAR, including landslides, fires, floods, earthquakes, earthflows, and glaciers

Landscape features and geologic mapping

This part covers automated geologic mapping with supervised machine learning. Models are trained from geomorphic surface features and surface-geology constraints, then the mapped units are reconstructed as cross-sections and a 3D structural model.

Multiscale CWT complexity Sheep Mountain, Wyoming — DEM + 2D Mexican-hat continuous wavelet transform (pyTopoComplexity): ridges and valleys, mean complexity, A–A′ energy profile, and dominant wavelength.

Automatic geologic mapping at Sheep Mountain Sheep Mountain, Wyoming — 64-band AlphaEarth embeddings + supervised ML, trained on USGS geologic map units in the northwest half and validated on the held-out southeast half (accuracy 91.0%, macro-F1 0.89).

Method Bands Validation accuracy Macro-F1
Engineered spectral and terrain 29 69.1% 0.64
AlphaEarth embeddings 64 91.0% 0.89
Combined 93 89.5% 0.87

Cross-section Sheep Mountain, Wyoming — mapped units + 3-point bed attitudes projected to A–A′ and B–B′ (~60° apart), with the published SW-dipping ~50° basement thrust.

Rotating Sheep Mountain block and sections Sheep Mountain, Wyoming — reconstructed 3D geologic block with matching faulted A–A′ and B–B′ sections; 72 frames at 3 fps (about 24 seconds per turn).

Surface change

This part is a set of toolkits for detecting surface change at different temporal and spatial scales, using a range of remote-sensing data types and methods.

2014 Oso landslide, Washington 2014 Oso landslide, Washington — DEMs (pre COP30, post 3DEP lidar) → DEM of Difference (red = erosion, blue = deposit); Sentinel-2 spectral change (ΔNDVI, ΔNBR); and terrain Δ complexity via CWT (pyTopoComplexity).

Holiday Farm Fire, Oregon 2020 Holiday Farm Fire, Oregon — Sentinel-2 SWIR–NIR–red composites before and after, and burn-ratio change (ΔNBR); cyan outline marks higher debris-flow hazard.

Yolo Bypass Flood, California 2019 Yolo Bypass flood, California — Sentinel-2 before and during the flood, and water-index change (ΔNDWI); cyan outline is the mapped shoreline.

Myanmar 2025 earthquake LiCSAR 2025 Mw 7.7 Sagaing Fault earthquake, Myanmar — Sentinel-1 LiCSAR InSAR: north–south displacement, azimuth and range offsets, and wrapped phase.

Slumgullion Earthflow, Colorado Slumgullion Earthflow, Colorado — NAIP optical feature tracking (velocity 2017–2023), UAVSAR LOS and rewrapped phase (12–19 August 2011), and DEM difference 2024−2015 (red = lowering, blue = raising). Arrows are optical motion only.

Jakobshavn ITS_LIVE glacier velocity Jakobshavn Isbræ, West Greenland — NASA ITS_LIVE velocity: 2018 surface speed with flow directions, and 2018−2016 speed change.

Five notebooks in notebooks/ walk through every module with public data (spectral and surface change, terrain complexity, auto-mapping and cross-sections, 3D, and a multi-hazard showcase).

Quick start

from pygeomapper import raster_io, surface_change, terrain_analysis

dem1 = raster_io.load_geotiff("example_data/oso_dem_pre_cop30.tif")
dem2 = raster_io.load_geotiff("example_data/oso_dem_post_3dep.tif")
dod = surface_change.compute_dod(dem1, dem2)                        # elevation change between the two DEMs
cwt = terrain_analysis.compute_multiscale_complexity(dem2)          # terrain roughness at several scales

License

Code: AGPL-3.0-or-later. You are free to use, modify, and share it; anyone distributing modified code or running a modified version as a network service must share its source under the same license.

Third-party notices and data credits: NOTICE.

About

Geologic and surface-change mapping from satellite images and DEMs.

Resources

Stars

54 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages