Files
gis-actions/suites/test-windows/workflow.yaml
T
SuiteForge bb7546150a docs: 大幅完善套件说明
- 套件描述:内置数据说明、预期结果、输出格式
- 参数描述:路径示例、输出文件含什么
- 步骤描述:每步做什么、怎么做的、预期什么
- 环境要求:runtime 说明、依赖说明
2026-07-21 00:32:00 +08:00

90 lines
3.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: 云南省界叠加分析(Windows 测试)
description: >
验证 GIS Actions 4.0 Windows 双平台(arcpy + Python3)执行链路的测试套件。
【内置测试数据】
套件包内含 4 个 GeoJSON 文件,开箱即用,无需用户准备数据:
- yunnan.geojson — 云南省界(面),作为叠加分析的目标区域
- kunming.geojson — 昆明市界(面),预期在云南省内,叠加结果为"通过"
- dali.geojson — 大理州界(面),预期在云南省内,叠加结果为"通过"
- baise.geojson — 广西百色市界(面),预期不在云南省内,叠加结果为"不通过"
【执行流程】
Step 1 (GeoJSON → SHP) — 用 arcpy.JSONToFeatures 将内置 GeoJSON 转为 Shapefile
Step 2 (叠加分析) — 用 arcpy 空间选择,判断城市中心点是否在省界内
Step 3 (输出 Excel) — 用 openpyxl 将分析结果写入 Excel,含条件高亮
【预期输出】
输出的 Excel 文件包含一张"叠加分析结果"工作表,含 7 列:
城市 | 城市代码 | 城市名称 | 人口 | 在省内 | 相交 | 状态
预期结果:
- 昆明市 ✅ 在省内(通过,绿色高亮)
- 大理州 ✅ 在省内(通过,绿色高亮)
- 百色市 ❌ 不在省内(不通过,红色高亮)
Step 1 和 Step 2 依赖系统 ArcGIS arcpy 环境(Python 2.7),
Step 3 使用 python3 运行时(Windows 本机 Python 3 环境)。
【环境要求】
- ArcGIS 10.x(含 arcpy
- Python 3(用于 Excel 输出步骤)
- openpyxl 库(pip install openpyxl
version: 1.0.1
author: SuiteForge
platform: windows
slug: test-yunnan-overlay-windows
tags: [测试, 叠加分析, Windows, 云南省, 验证套件]
category: 测试验证
params:
output_path:
type: string
required: true
desc: >
输出 Excel 文件路径,例如 C:\Users\test\output\result.xlsx。
文件包含"叠加分析结果"工作表,标题行有表头,数据行按通过/不通过绿色/红色高亮。
steps:
- id: geojson_to_shp
name: 内置数据 → 转为 Shapefile
description: >
从套件包内置 data/ 目录读取 4 个 GeoJSON 文件(云南省界 + 昆明/大理/百色),
用 arcpy.JSONToFeatures_conversion 转为 ESRI Shapefile 格式,
存入共享工作目录 /tmp/output/shp/。
注意:arcpy 步骤运行在 Python 2.7 环境。
runtime: arcpy
script_id: arcpy_convert
params:
output_dir: /tmp/output/shp
- id: overlay
name: 叠加分析(空间选择)
description: >
读取省界 Shapefile,创建要素图层(MakeFeatureLayer),
对每个城市创建要素图层后使用 FeatureToPoint 计算几何中心点,
再用 SelectLayerByLocationWITHIN 关系)判断中心点是否在省界内。
输出分析结果 JSON 到 /tmp/output/result/。
预期结果:昆明、大理在省内通过;百色不在省内不通过。
注意:arcpy 步骤运行在 Python 2.7 环境。
runtime: arcpy
script_id: arcpy_overlay
depends_on: [geojson_to_shp]
params:
province_shp: /tmp/output/shp/province.shp
cities_dir: /tmp/output/shp
output_dir: /tmp/output/result
- id: export_excel
name: 输出 Excel 报表
description: >
读取叠加分析结果 JSON,用 openpyxl 生成格式化的 Excel 工作簿。
表头加粗白色字蓝色底色,数据行按"在省内"为是/否分别绿色/红色高亮。
写入用户指定的 output_path。
注意:此步骤使用 python3 运行时在 Windows 本机 Python 3 环境执行。
runtime: python3
script_id: excel
depends_on: [overlay]
params:
result_dir: /tmp/output/result
output_path: $params.output_path