Geoskill: River Morphology Change

Extract shorelines, centerlines and channel widths from multi-temporal water body masks. Quantify shoreline migration, channel migration, change hotspots and migration zones. Use w…

ruiduobao

@ruiduobao

Install

$ openclaw skills install @ruiduobao/geoskill-river-morphology-change

River Morphology Change

Extracts shorelines, centerlines, and channel widths from multi-temporal water body masks. Quantifies shoreline migration, channel migration, and change hotspots.

Trigger

Use when the user wants to:

  • Analyze river channel migration from multi-temporal imagery
  • Identify erosion and deposition areas along river banks
  • Compute channel width changes over time
  • Detect change hotspots where migration is most severe
  • Generate river morphology change reports
  • Compare shorelines between different time periods

CLI Usage

# Basic analysis with default parameters
python scripts/river_morphology_change.py --output-dir ./rmc-output

# Custom transect spacing and hotspot percentile
python scripts/river_morphology_change.py \
  --transect-spacing 30.0 \
  --hotspot-percentile 85.0 \
  --output-dir ./rmc-output

# With custom water threshold
python scripts/river_morphology_change.py \
  --water-threshold 0.1 \
  --min-channel-width 15.0 \
  --output-dir ./rmc-output

Parameters

ParameterDefaultDescription
--input-masksNoneInput water mask GeoTIFF files (ordered by time)
--transect-spacing50.0Distance between transects in map units
--min-channel-width20.0Minimum channel width for quality flagging
--shoreline-methodthresholdShoreline extraction method: threshold, canny, manual
--water-threshold0.0Water extraction threshold (NDWI/MNDWI)
--hotspot-percentile90.0Percentile threshold for hotspot detection
--output-dir./rmc-outputOutput directory

Output

FileDescription
shorelines.geojsonShoreline features for each time period
centerlines.geojsonCenterline features for each time period
transects.geojsonPerpendicular transect lines along centerline
migration_rates.csvMigration distances and rates per transect
change_hotspots.geojsonHotspot features where migration exceeds threshold
request.jsonAnalysis request metadata
dataset-manifest.jsonDataset inventory and period information
output-manifest.jsonOutput file inventory and statistics
qa.jsonQuality assurance checks

Quality Codes

CodeNameDescription
1highClean intersection, single shoreline crossing
2mediumSmall migration or minor complexity
3lowMultiple intersections, complex geometry
4invalidNo intersection or processing error

Direction Codes

CodeNameDescription
-1erosionShoreline retreats (water expands)
0stableNo significant change
1depositionShoreline advances (water contracts)

Key Algorithms

Water Body Extraction

Uses NDWI (Normalized Difference Water Index) or MNDWI (Modified NDWI) to extract water bodies from multispectral imagery:

  • NDWI = (Green - NIR) / (Green + NIR)
  • MNDWI = (Green - SWIR1) / (Green + SWIR1)

Centerline Extraction

Uses Voronoi-based medial axis extraction:

  1. Sample points along water polygon boundary
  2. Compute Voronoi diagram of boundary points
  3. Extract Voronoi vertices inside polygon as centerline
  4. Fallback to bounding box centerline if scipy unavailable

Transect Generation

Generates perpendicular transects along the centerline at regular intervals. Each transect is perpendicular to the local tangent direction.

Migration Rate Computation

Uses perpendicular intersection method:

  1. For each transect, find intersection with both shorelines
  2. Measure distance between intersection points
  3. Determine direction (erosion/deposition) based on distance from center

Change Hotspot Detection

Identifies transects where migration distance exceeds the specified percentile threshold (default: 90th percentile).

Exit Codes

CodeMeaning
0Success
2Argument error
3Dependency missing
6Data validation failure
7Processing failure

Limitations

  • Water level changes may be misinterpreted as morphological change
  • Narrow channels near pixel resolution limit have reduced accuracy
  • Centerline topology handling is complex for braided/anastomosing channels
  • Results are auxiliary analysis only; engineering decisions require manual review
  • Same-season imagery recommended to minimize water level effects

References

  • Pavelsky & Smith 2008, IEEE GRSL (RivWidth algorithm)
  • Isikdogan et al. 2017, IGARSS (RivMap automatic river width extraction)
  • Fisher et al. 2013, Nature Geoscience (global river delta assessment)

数据下载

本 skill 可自动从 Microsoft Planetary Computer 下载数据 (无需 API key):

python river_morphology_change.py --bbox 116,39,117,40 --date-range 2024-06-01,2024-06-30 --output-dir <tmp>
  • --bbox W,S,E,N: WGS-84 边界框 (西, 南, 东, 北)
  • --date-range START,END: 日期范围 (YYYY-MM-DD,YYYY-MM-DD)
  • --aoi-file <path.geojson>: 替代 --bbox 的 GeoJSON 多边形
  • --cache-dir <path>: 缓存目录 (默认 ~/.geoskill_cache)

当用户只给 --bbox + --date-range (没有 --image) 时,skill 自动下载数据。 当用户给 --image 时,走原文件路径 (向后兼容)。

Top skills in this category