Coding

Geoskill: Cropland Abandonment Detection

Try it

Multi-year cropland abandonment detection using NDVI time series. Identifies suspected abandoned cropland based on consecutive years without cultivation signals. Use when screening for abandoned fields, generating field verification lists, or monitoring cultivation continuity.

What it does

Multi-year cropland abandonment detection using NDVI time series. Identifies suspected abandoned cropland based on consecutive years without cultivation signals. Use when screening for abandoned fields, generating field verification lists, or monitoring cultivation continuity.

The skill document

Cropland Abandonment Detection

Detects suspected abandoned cropland from multi-year NDVI time series.

Trigger

Use when the user wants to:

  • Screen for abandoned cropland
  • Identify fields with consecutive years without cultivation
  • Generate field verification priorities
  • Monitor cultivation continuity

CLI Usage

# Basic detection
python scripts/cropland_abandonment_detection.py \
  --ndvi-stack ndvi_2018_2023.tif

# With cropland mask and custom thresholds
python scripts/cropland_abandonment_detection.py \
  --ndvi-stack ndvi_2018_2023.tif \
  --cropland-mask cropland.tif \
  --ndvi-threshold 0.25 --min-abandoned-years 3

# Specify years
python scripts/cropland_abandonment_detection.py \
  --ndvi-stack ndvi_stack.tif \
  --years 2018 2019 2020 2021 2022 2023

# Synthetic demo (no real stack/mask needed)
python scripts/cropland_abandonment_detection.py --synthetic --output-dir ./abandonment-output

Parameters

ParameterDefaultDescription
--ndvi-stack(required unless --synthetic)Multi-year NDVI stack (bands=years)
--cropland-maskNoneCropland mask (1=cropland)
--yearsautoYears for each band
--ndvi-threshold0.3Min max-NDVI for cultivation
--min-abandoned-years2Min consecutive fallow years
--min-area0Minimum field area filter
--output-dir./abandonment-outputOutput directory
--syntheticfalseRun with synthetic demo data (auto-generates NDVI stack + mask)

Output

FileDescription
abandonment_status.tif3-band raster (abandoned, duration, start_year)
suspected_fields.geojsonVector of abandoned field polygons
report.htmlHTML summary report
output-manifest.jsonMachine-readable manifest

Exit Codes

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

数据下载

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

python cropland_abandonment_detection.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 (没有 --image) 时,skill 自动下载数据。 当用户给 --image 时,走原文件路径 (向后兼容)。

Related skills

Detect and classify cropland changes from before/after NDVI rasters. Identifies suspected construction, water, forest, and bare soil changes and generates compliance investigation materials. Use when the user wants to check farmland for unauthorized changes, monitor cropland conversion, or generate compliance reports.

1 installs

Assess crop health from NDVI time series. Use when the user wants to analyze changes, detect hazards, or generate assessment reports.

1 installs

Identify major crop types from multi-temporal optical/SAR imagery using phenological features. Produces pixel/field-level classification, area statistics, and confidence maps. Use when mapping crop distributions, estimating planted areas, or generating agricultural intelligence from remote sensing data.

1 installs

Fuses crop distribution, hazard intensity, and NDVI anomaly to estimate agricultural disaster impact. Classifies damage severity (mild/moderate/severe) and generates field-level damage maps. Use when assessing flood/drought/heat impact on crops.

1 installs

Detect forest disturbance from multi-temporal NDVI. Use when the user wants to analyze changes, detect hazards, or generate assessment reports.

1 installs

高分辨率作物识别叠加申报地块做差异检测,核查补贴合规性。Verifies subsidy compliance by overlaying high-resolution crop classification on declared parcels for difference detection.