From ccaaace1a9b73cde2c34df02f4899e2f3f026fa5 Mon Sep 17 00:00:00 2001 From: Huawei Date: Thu, 9 Jul 2026 15:10:31 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20suites-help/=E7=A4=BA=E4=BE=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81/=E7=BC=93=E5=86=B2=E5=8C=BA=E5=88=86=E6=9E=90.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suites-help/示例代码/缓冲区分析.md | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 suites-help/示例代码/缓冲区分析.md diff --git a/suites-help/示例代码/缓冲区分析.md b/suites-help/示例代码/缓冲区分析.md new file mode 100644 index 0000000..bc393e3 --- /dev/null +++ b/suites-help/示例代码/缓冲区分析.md @@ -0,0 +1,64 @@ +# 缓冲区分析套件 + +## 功能 + +对 GeoJSON 中的地块做缓冲区分析,输出处理前后的面积对比报告。 + +## workflow.yaml + +```yaml +name: parcel-analysis +description: 地块数据批处理 — 生成→验证→缓冲区→对比→报告 +version: 2.0.0 +category: gis-processing +tags: [gis, parcel, buffer] + +params: + type: object + required: + - buffer_distance + properties: + buffer_distance: + type: number + default: 0.5 + description: 缓冲区距离(度) + +steps: + - id: main + name: 全流水线 + script_id: process + params: + buffer_distance: "${{inputs.buffer_distance}}" + +resolved_params: + - step_index: 0 + step_name: 全流水线 + params: + buffer_distance: 0.5 +``` + +## 处理流程 + +5 个阶段在单脚本中顺序执行: + +| 阶段 | 功能 | 产出 | +|------|------|------| +| Phase 1 | 生成 3 个示例地块 GeoJSON | `input_parcels.geojson` | +| Phase 2 | 验证 GeoJSON 结构、统计要素 | 校验报告 | +| Phase 3 | 缓冲区分析(顶点偏移算法) | `buffered_parcels.geojson` | +| Phase 4 | 计算每个地块处理前后的面积变化 | 面积对比 JSON | +| Phase 5 | 生成完整的对比报告 | `comparison_report.json` | + +## 输出示例 + +```json +{ + "areas": [ + {"id": "P001", "before": 0.02, "after": 0.308, "change_pct": 1439.34}, + {"id": "P002", "before": 0.018, "after": 0.327, "change_pct": 1717.11} + ], + "total_before": 0.056, + "total_after": 0.962, + "total_change_pct": 1617.91 +} +```