Install
openclaw skills install @ruiduobao/geoskill-agriculture-subsidy-verification高分辨率作物识别叠加申报地块做差异检测,核查补贴合规性。Verifies subsidy compliance by overlaying high-resolution crop classification on declared parcels for difference detection.
openclaw skills install @ruiduobao/geoskill-agriculture-subsidy-verificationUses an NDVI raster derived from remote sensing imagery to classify crop/non-crop by threshold, overlays it with the vector parcels declared for subsidy, computes the "remotely sensed crop fraction" per parcel, and compares it with the "declared crop fraction": parcels exceeding the tolerance are flagged as suspected violations (over-declared / under-declared). This is a simplified implementation of the area-consistency check used in the EU CAP "Checks by Monitoring" and in national cropland subsidy verification.
Two verification methods:
area-diff (default): flagged when |measured fraction − declared fraction| > tolerance;class-match: binarizes declared/measured fractions into "crop/non-crop" at the 0.5 boundary, flagged when classes do not match.Data quality rules: NoData pixels are excluded from statistics; parcels with no valid pixels inside (or parcels smaller than the pixel and thus not burned in) are recorded as no-coverage and are not flagged as violations; NDVI values are validated to [-1,1]; bbox does not support crossing the 180° meridian.
pip install 'numpy' 'rasterio' 'geopandas' 'shapely'
python geoskill-agriculture-subsidy-verification.py --bbox 116.0 39.0 117.0 40.0 [other parameters]
python geoskill-agriculture-subsidy-verification.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --output-dir ./out
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --method class-match --tolerance 0.1
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --threshold 0.35
python geoskill-agriculture-subsidy-verification.py --input ndvi_utm.tif --parcels parcels_utm.gpkg --output-dir ./out
| File | Format | Description |
|---|---|---|
crop_mask.tif | GeoTIFF | Crop mask (1=crop, 0=non-crop, nodata in NoData areas) |
parcel_grid.tif | GeoTIFF | Parcel ID raster (background 0, parcels start from 1) |
verification_report.json | JSON | Per-parcel verification records and statistics (primary output) |
flagged_parcels.geojson | GeoJSON | Vector of suspected violation parcels |
output-manifest.json | JSON | Run manifest |
Local high-resolution NDVI GeoTIFF (EPSG:4326; projected coordinates are automatically reprojected) + declared parcel vectors (GeoJSON/GPKG/Shapefile, must contain parcel_id and declared_crop_frac columns, with declared fraction in [0,1]); --synthetic mode simulates offline without network.
--synthetic mode requires no network at all.MIT
用遥感影像派生的 NDVI 栅格做作物/非作物阈值分类,与申报补贴的地块矢量叠加, 逐地块计算"遥感实测作物占比",与"申报作物占比"比较,超过容差即标记为疑似违规 (虚报 over-declared / 少报 under-declared)。这是欧盟 CAP "Checks by Monitoring" 与各国耕地补贴核查中面积一致性检查的简化实现。
两种核查方法:
area-diff(默认):|实测占比 − 申报占比| > tolerance 即标记;class-match:以 0.5 为界把申报/实测二值化为"作物/非作物",类别不一致即标记。数据质量规则:NoData 像元不参与统计;地块内无有效像元(或地块小于像元未被烧录)
记为 no-coverage,不判定违规;NDVI 值域校验 [-1,1];bbox 不支持跨 180° 经线。
pip install 'numpy' 'rasterio' 'geopandas' 'shapely'
python geoskill-agriculture-subsidy-verification.py --bbox 116.0 39.0 117.0 40.0 [其他参数]
python geoskill-agriculture-subsidy-verification.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --output-dir ./out
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --method class-match --tolerance 0.1
python geoskill-agriculture-subsidy-verification.py --input ndvi.tif --parcels parcels.geojson --threshold 0.35
python geoskill-agriculture-subsidy-verification.py --input ndvi_utm.tif --parcels parcels_utm.gpkg --output-dir ./out
| 文件 | 格式 | 说明 |
|---|---|---|
crop_mask.tif | GeoTIFF | 作物掩膜(1=作物,0=非作物,NoData 区域为 nodata) |
parcel_grid.tif | GeoTIFF | 地块编号栅格(背景 0,地块从 1 起) |
verification_report.json | JSON | 逐地块核查记录与统计(主产物) |
flagged_parcels.geojson | GeoJSON | 疑似违规地块矢量 |
output-manifest.json | JSON | 运行清单 |
本地高分辨率 NDVI GeoTIFF(EPSG:4326;投影坐标自动重投影)+ 申报地块矢量
(GeoJSON/GPKG/Shapefile,需含 parcel_id 与 declared_crop_frac 列,
申报占比取值 [0,1]);--synthetic 模式离线模拟,无需网络。
--synthetic 模式完全无网络。MIT