Geoskill: Crop Type Mapping

Identify major crop types from multi-temporal optical/SAR imagery using phenological features. Produces pixel/field-level classification, area statistics, and confidence maps. Use …

ruiduobao

@ruiduobao

Install

$ openclaw skills install @ruiduobao/geoskill-crop-type-mapping

Prerequisites / 先准备 X 文件

⚠️ 必读 — 本 skill 不属于即用型,需要先准备特定文件才能跑。

本 skill 需要 bbox/AOI + 年份/日期范围。时序影像自动下载,但 训练标签和物候 schema 是可选的——内置 4 种作物(水稻/小麦/玉米/大豆)够用。

👉 完整教程见仓库根目录 PREREQUISITES.md 1.2 节。

先准备 X 文件:自动下载 + 内置物候 = 1 行命令可跑通。

快速试跑命令:

python crop_type_mapping.py --bbox 113.0,29.5,114.5,31.0 --year 2024 --output-dir ./ctm

Crop Type Mapping

Identifies major crop types (rice, wheat, corn, etc.) from multi-temporal satellite imagery using phenological curve matching and spectral indices.

Trigger

Use when the user wants to:

  • Map crop type distribution for a region (e.g., "identify rice/wheat/corn in Henan 2024")
  • Estimate planted area by crop type with confidence intervals
  • Generate crop classification maps from Sentinel-2/Landsat time series
  • Compare crop patterns across years or regions
  • Produce agricultural intelligence reports for government or insurance

CLI Usage

# Basic: classify crops in a bounding box for a given year
python scripts/crop_type_mapping.py \
  --bbox 113.0,29.5,114.5,31.0 \
  --year 2024

# Using a place name
python scripts/crop_type_mapping.py \
  --place beijing \
  --year 2024

# With custom date range and output directory
python scripts/crop_type_mapping.py \
  --bbox 115.0,30.0,116.0,31.0 \
  --start-date 2024-04-01 \
  --end-date 2024-10-31 \
  --output-dir ./ctm-output

# With custom crop schema and method
python scripts/crop_type_mapping.py \
  --aoi-file region.geojson \
  --year 2024 \
  --crop-schema references/crop_phenology.json \
  --method rule \
  --min-patch-area 9

Parameters

ParameterDefaultDescription
--placePlace name (e.g., 'beijing', 'shanghai')
--bboxBounding box: 'xmin,ymin,xmax,ymax' (WGS84)
--aoi-fileAOI file (GeoJSON or Shapefile)
--yearcurrentYear for analysis (2015-2030)
--start-dateStart date (YYYY-MM-DD), mutually exclusive with --year
--end-dateEnd date (YYYY-MM-DD)
--crop-schemabuilt-inCustom crop phenology schema JSON
--labelsTraining/validation labels (GeoJSON)
--methodruleClassification method: rule, rf, xgboost
--min-observations5Minimum valid observations per pixel
--field-boundariesField boundary polygons (GeoJSON)
--min-patch-area4Minimum patch area in pixels (post-processing)
--output-dir./ctm-outputOutput directory

Note: --place, --bbox, and --aoi-file are mutually exclusive.

Output

FileDescription
crop_classes.tifCrop classification raster (class codes)
crop_confidence.tifPer-pixel classification confidence (0-1)
crop_polygons.geojsonVector polygons per crop region
area_by_admin.csvArea statistics per crop class (ha, km², %)
accuracy.jsonConfusion matrix, overall accuracy, per-class F1
request.jsonInput parameters and AOI metadata
dataset-manifest.jsonData source and observation metadata
output-manifest.jsonOutput file inventory and summary
qa.jsonQuality assurance checks and status
run.logExecution log

Crop Types (Default Schema)

CropCodePeak DOYDescription
Rice1220 (Aug)Single-season late rice
Wheat2120 (Apr)Winter wheat
Corn3200 (Jul)Summer corn

Classification Methods

MethodDescription
rulePhenological curve matching using peak DOY and amplitude
rfRandom Forest (requires sklearn, falls back to rule)
xgboostXGBoost (requires sklearn, falls back to rule)

Workflow

  1. AOI parsing — resolve place/bbox/aoi-file to WGS84 bounding box
  2. Time range — parse year or custom date range
  3. Data preparation — search/acquire Sentinel-2/Landsat time series
  4. Feature extraction — compute NDVI, EVI, LSWI + phenological features
  5. Classification — rule-based or ML classification per pixel
  6. Post-processing — small patch removal, spatial smoothing
  7. Accuracy assessment — confusion matrix, per-class metrics
  8. Area statistics — pixel-counting with spherical area correction
  9. Output — GeoTIFF, GeoJSON, CSV, JSON reports

Exit Codes

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

Limitations

  • Classification is remote-sensing-based estimation, not ground truth
  • Accuracy depends on cloud-free observation count and timing
  • Crop schema defaults are tuned for major grain regions (North China Plain)
  • Double-cropping regions may require custom schema
  • Results should be validated with ground truth before operational use

数据下载

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

python crop_type_mapping.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

novel-generator 是一个中文爽文小说生成技能。用户只需提供一句话方向(如"写个都市重生爽文"),AI 代理即可自动完善提示词、规划大纲、逐章创作并输出为独立 Markdown 文件。 核心特性: 智能提示词生成:从一句话方向自动补全世界观、人设、冲突、爽点设计 分章节创作:每章 2000-3000 字,层层递进,章章有爽点 记忆系统:通过 .learnings/ 记录角色、地点、情节、世界观,确保故事前后一致 情节图解:关键战斗、人物关系、势力分布自动生成 Mermaid 图 失败记录:穿帮、矛盾、崩塌等问题自动记录,持续优化 多题材支持:都市、修仙、玄幻、重生、系统流、末世、科幻、游戏 兼容 Claude Code、Cursor、OpenAI Codex、GitHub Copilot 等所有支持 Agent Skills 的工具。

@ityhg

根据用户提供的内容方向自动生成提示词并创作爽文小说。适用场景:(1) 用户提供小说方向/题材/关键词,(2) 需要生成章节连贯的长篇爽文,(3) 需要维护角色、地点、情节的连续性,(4) 需要为关键情节生成图解,(5) 需要记录生成失败场景以优化后续创作。支持都市、修仙、玄幻、重生、系统流等多种题材。Use wh...

7110k

Video Agent (Deprecated)

@michaelwang11394

[DEPRECATED — uses outdated v1/v2 endpoints] Use `create-video` for prompt-based video generation (v3 Video Agent) or `avatar-video` for precise avatar/scene...

76.3k

Skill Vetter

@spclaudehome

Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.

1.3k271k

Clawdhub

@steipete

Use the ClawdHub CLI to search, install, update, and publish agent skills from clawdhub.com. Use when you need to fetch new skills on the fly, sync installed skills to latest or a specific version, or publish new/updated skill folders with the npm-installed clawdhub CLI.

25338k

SuperDesign

@mpociot

Expert frontend design guidelines for creating beautiful, modern UIs. Use when building landing pages, dashboards, or any user interface.

19341k