Skip to content

kentstephen/landsat_change_detection

Repository files navigation

Landsat H3 Change Detection

Detect vegetation changes over time using Landsat imagery aggregated to H3 hexagons.

Compares EVI (Enhanced Vegetation Index) and NDVI (Normalized Difference Vegetation Index) between two time periods (e.g., 1990s vs 2020s) and outputs change metrics per H3 cell.

image Screenshot 2026-01-10 at 3 31 59 PM

Background

Case Study: Chernobyl Exclusion Zone

The 1986 Chernobyl disaster was catastrophic—the worst nuclear accident in history. Yet in the decades since evacuation, the Exclusion Zone has become an unintentional experiment in what happens when humans withdraw from a landscape. This notebook uses satellite imagery to examine one aspect of that story: vegetation change between the early 1990s and 2020s.

Inspired by Cal Flyn's Islands of Abandonment, which includes her trip to Chernobyl and Pripyat before the Russian invasion.

I think this type of tool could be useful for analysis of change over time and can be repurposed for different types of sensors and other spectral indices.

Setup & Usage

Install uv and clone the repo:

curl -LsSf https://astral.sh/uv/install.sh | sh  # or: brew install uv
git clone https://github.com/kentstephen/landsat_change_detection.git
cd landsat_change_detection

Option A: One-liner with juv - runs notebook with inline dependencies (PEP 723):

uvx juv run landsat_vegetation_change_h3.ipynb

Option B: Install to venv - use uv sync then open notebook in your IDE:

uv sync

Data Sources

This project supports two STAC endpoints for Landsat data:

Option 1: Element84 Earth Search

Uses requester-pays S3 buckets. You will need to use new or existing AWS secrets. For purposes of accessing Landsat imagery in S3 this way, the IAM user defined for this purpose will only need AmazonS3ReadOnlyAccess.

# Create .env file with your AWS credentials
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret

# Optional: Mapbox token for satellite basemap with labels
MAPBOX_TOKEN=your_mapbox_token

It cost me less than 20 cents of compute to develop this example using AWS/Element84.

Option 2: Microsoft Planetary Computer

This notebook uses sign_inplace so no extra credentials are needed. However, AWS/Element84 is generally more reliable.

How It Works

  1. Query STAC catalog for Landsat scenes in your AOI
  2. Load imagery with odc-stac (uses dask for parallel S3 fetching)
  3. Calculate EVI or NDVI per pixel
  4. Aggregate to H3 hexagons using DuckDB's H3 extension
  5. Compare early vs recent periods to compute change

Core Dependencies

  • odc-stac - Cloud-native raster loading
  • duckdb + H3 extension - Fast spatial aggregation
  • h3 - Uber's hexagonal grid system
  • lonboard - GPU-accelerated map visualization
  • dask - Parallel array computing with task scheduling
  • pyarrow - Apache Arrow for zero-copy data interchange

This notebook is not meant to be conclusive science - just a means of exploration

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •