Add temporal analysis and raster change detection

Open
#1,136 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
data

Research direction

No specific files, entry points, or tests are named. Start by reviewing the existing raster-analysis algorithms and their xarray time-dimension handling, then define the smallest supported slice of the proposed scope. Done should include the selected temporal-analysis capability, documented behavior for stacked rasters, and validation of Dask-compatible per-pixel processing.

Written by the indexing model from the issue text.

Description

after-1.0.0-release enhancement

Motivation

xarray-spatial handles single-time raster analysis well, but lacks tools for multi-temporal workflows. With Sentinel-2, MODIS, and Landsat time series now standard inputs, users regularly need change detection and trend analysis on stacked rasters. Currently this means writing custom code or pulling in unrelated libraries.

Scope

Image differencing and change vectors:

  • Simple band differencing between two dates
  • Change vector analysis (CVA) that computes magnitude and direction of change across multiple bands

Land cover transitions:

  • From/to transition matrices with area estimates (goes beyond what zonal_crosstab does today)
  • Per-class gain/loss/swap/net-change decomposition

Pixel-level trend analysis:

  • Mann-Kendall test for monotonic trend detection over a time series
  • Theil-Sen slope estimator (robust to outliers, good for NDVI trends)

Phenology extraction from NDVI time series:

  • Start of season, end of season, peak timing
  • Seasonal amplitude and integrated greenness

Implementation notes

  • Should work with xarray's time dimension natively, operating along the time axis of a 3D (time, y, x) DataArray.
  • Dask support matters here more than usual since time stacks can be tens of GB. Per-pixel operations (trend tests, phenology) parallelize naturally across spatial chunks.
  • Mann-Kendall and Theil-Sen are per-pixel reductions along the time axis, similar to how apply_ufunc works.
  • Phenology extraction will likely need interpolation or smoothing as a preprocessing step. Could use a simple Savitzky-Golay filter or similar.
Dominant language
Python
Stars
972
Forks
92
Avg merge
2d 12h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/xarray-spatial

All issues in xarray-contrib/xarray-spatial

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.