编程

Geoskill: Watershed Delineation

试用

Automated watershed delineation from DEM. Computes D8 flow direction, flow accumulation, delineates watersheds from outlet points, extracts stream networks, and generates statistics. Use when the user wants to delineate a watershed, compute flow accumulation, extract streams, or analyze hydrological characteristics from a DEM.

它能做什么

Automated watershed delineation from DEM. Computes D8 flow direction, flow accumulation, delineates watersheds from outlet points, extracts stream networks, and generates statistics. Use when the user wants to delineate a watershed, compute flow accumulation, extract streams, or analyze hydrological characteristics from a DEM.

技能文档

Watershed Delineation

Automated watershed analysis from DEM using D8 algorithm.

CLI Usage

python scripts/watershed_delineation.py --dem dem.tif
python scripts/watershed_delineation.py --dem dem.tif --outlet-row 50 --outlet-col 60
python scripts/watershed_delineation.py --dem dem.tif --stream-threshold 50
python scripts/watershed_delineation.py --synthetic --output-dir ./out

数据下载

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

# 自动下载 Copernicus DEM GLO-30
python scripts/watershed_delineation.py \
    --bbox 116.30,39.85,116.45,39.95 \
    --date-range 2020-01-01,2020-12-31 \
    --output-dir ./ws-auto

下载的内容:

  • Copernicus DEM GLO-30 (cop-dem-glo-30) — 替换 --dem

下载元数据(data_source, fetched_at, collection, dem_downloaded)会写入 output-manifest.json

Parameters

FlagTypeDefaultDescription
--dempath(required, or use --synthetic)Input DEM raster (GeoTIFF)
--outlet-rowintNoneOutlet row in DEM grid (default: max accumulation)
--outlet-colintNoneOutlet column in DEM grid (default: max accumulation)
--stream-thresholdint100Stream threshold in accumulation pixels
--output-dir / -opathwatershed-outputOutput directory
--syntheticflagFalseRun with synthetic demo data (no real inputs needed)
--versionflag-Show version and exit

Output

FileDescription
flow_direction.tifD8 flow direction raster
flow_accumulation.tifFlow accumulation raster
watershed.tifWatershed mask
streams.tifStream network
report.htmlStatistics report
output-manifest.jsonMachine-readable manifest

Exit Codes

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

数据下载

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

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

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

相关技能

Extract shorelines, centerlines and channel widths from multi-temporal water body masks. Quantify shoreline migration, channel migration, change hotspots and migration zones. Use when analyzing river channel changes, identifying erosion/deposition areas, or generating river morphology reports.

1 次安装

基于 DEM 的 Bathtub 静态洪水淹没模拟,支持水文连通性约束(flood-fill)。Static bathtub flood inundation modeling from DEM with optional hydrological connectivity constraint. 输出淹没范围/水深 GeoTIFF + 面积体积统计 JSON。

Identify potential debris-flow gullies, integrate terrain, material source, rainfall trigger, and downstream exposure to produce basin-level hazard screening and risk assessment.

1 次安装

Overlay flood extent with population, buildings, roads, and cropland to estimate affected objects and generate impact reports. Use when the user wants to assess flood impact, count affected population/roads/buildings, or generate flood impact summaries from a flood extent raster.

1 次安装

Establish level-area-storage relationships from multi-period water surface, DEM, and water level data. Monitor reservoir capacity change and sedimentation trends. Use when analyzing reservoir storage changes, estimating current capacity, or detecting sedimentation from area-level curve shifts.

1 次安装