From bb7546150acf2375f0cc0497444a12244a2b6f6b Mon Sep 17 00:00:00 2001 From: SuiteForge Date: Tue, 21 Jul 2026 00:32:00 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E5=A4=A7=E5=B9=85=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=A5=97=E4=BB=B6=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 套件描述:内置数据说明、预期结果、输出格式 - 参数描述:路径示例、输出文件含什么 - 步骤描述:每步做什么、怎么做的、预期什么 - 环境要求:runtime 说明、依赖说明 --- suites/test-linux/workflow.yaml | 52 +++++++++++++++++++++++---- suites/test-windows/workflow.yaml | 60 +++++++++++++++++++++++++++---- 2 files changed, 100 insertions(+), 12 deletions(-) diff --git a/suites/test-linux/workflow.yaml b/suites/test-linux/workflow.yaml index 8abb70c..24bfb87 100644 --- a/suites/test-linux/workflow.yaml +++ b/suites/test-linux/workflow.yaml @@ -1,30 +1,66 @@ name: 云南省界叠加分析(Linux 测试) -description: 验证 GIS Actions 4.0 Linux 双平台执行链路的测试套件。内置云南/昆明/大理/百色 GeoJSON 示例数据,开箱即用。 +description: > + 验证 GIS Actions 4.0 Linux 双平台(Docker + Python3)执行链路的测试套件。 + + 【内置测试数据】 + 套件包内含 4 个 GeoJSON 文件,开箱即用,无需用户准备数据: + - yunnan.geojson — 云南省界(面),作为叠加分析的目标区域 + - kunming.geojson — 昆明市界(面),预期在云南省内,叠加结果为"通过" + - dali.geojson — 大理州界(面),预期在云南省内,叠加结果为"通过" + - baise.geojson — 广西百色市界(面),预期不在云南省内,叠加结果为"不通过" + + 【执行流程】 + Step 1 (GeoJSON → SHP) — 用 geopandas 将内置 GeoJSON 转为 Shapefile + Step 2 (叠加分析) — 用 geopandas 计算各城市中心点是否落在省界内 + Step 3 (输出 Excel) — 用 openpyxl 将分析结果写入 Excel,含条件高亮 + + 【预期输出】 + 输出的 Excel 文件包含一张"叠加分析结果"工作表,含 7 列: + 城市 | 城市代码 | 城市名称 | 人口 | 在省内 | 相交 | 状态 + 预期结果: + - 昆明市 ✅ 在省内(通过,绿色高亮) + - 大理州 ✅ 在省内(通过,绿色高亮) + - 百色市 ❌ 不在省内(不通过,红色高亮) + + Step 1 和 Step 2 依赖 gis-base 镜像(含 geopandas、openpyxl), + Step 3 使用 python3 运行时(Linux 本机 Python 环境)。 version: 1.0.1 author: SuiteForge platform: linux slug: test-yunnan-overlay-linux -tags: [测试, 叠加分析, Linux, 云南省] +tags: [测试, 叠加分析, Linux, 云南省, 验证套件] category: 测试验证 params: output_path: type: string required: true - desc: 输出 Excel 文件路径(.xlsx) + desc: > + 输出 Excel 文件路径,例如 /home/user/output/result.xlsx。 + 文件包含"叠加分析结果"工作表,标题行有表头,数据行按通过/不通过绿色/红色高亮。 base_image: gis-base:latest steps: - id: geojson_to_shp - name: 转为 SHP + name: 内置数据 → 转为 Shapefile + description: > + 从套件包内置 data/ 目录读取 4 个 GeoJSON 文件(云南省界 + 昆明/大理/百色), + 用 geopandas 读取后转为 ESRI Shapefile 格式,存入共享工作目录 /tmp/output/shp/。 runtime: docker script_id: convert params: output_dir: /tmp/output/shp - id: overlay - name: 叠加分析 + name: 叠加分析(空间判断) + description: > + 读取省界 Shapefile,读取各城市 Shapefile, + 使用投影坐标系(EPSG:3857)计算每个城市的几何中心点, + 判断中心点是否落在省界多边形内(contains), + 同时检查面面相交(intersects)作为辅助信息。 + 输出分析结果 JSON 到 /tmp/output/result/。 + 预期结果:昆明、大理在省内通过;百色不在省内不通过。 runtime: docker script_id: overlay depends_on: [geojson_to_shp] @@ -34,7 +70,11 @@ steps: output_dir: /tmp/output/result - id: export_excel - name: 输出 Excel + name: 输出 Excel 报表 + description: > + 读取叠加分析结果 JSON,用 openpyxl 生成格式化的 Excel 工作簿。 + 表头加粗白色字蓝色底色,数据行按"在省内"为是/否分别绿色/红色高亮。 + 写入用户指定的 output_path。 runtime: python3 script_id: excel depends_on: [overlay] diff --git a/suites/test-windows/workflow.yaml b/suites/test-windows/workflow.yaml index 38d7e0f..5989b64 100644 --- a/suites/test-windows/workflow.yaml +++ b/suites/test-windows/workflow.yaml @@ -1,28 +1,71 @@ name: 云南省界叠加分析(Windows 测试) -description: 验证 GIS Actions 4.0 Windows 执行链路的测试套件。内置云南/昆明/大理/百色 GeoJSON 示例数据,开箱即用。 +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, 云南省] +tags: [测试, 叠加分析, Windows, 云南省, 验证套件] category: 测试验证 params: output_path: type: string required: true - desc: 输出 Excel 文件路径(.xlsx) + desc: > + 输出 Excel 文件路径,例如 C:\Users\test\output\result.xlsx。 + 文件包含"叠加分析结果"工作表,标题行有表头,数据行按通过/不通过绿色/红色高亮。 steps: - id: geojson_to_shp - name: 转为 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: 叠加分析 + name: 叠加分析(空间选择) + description: > + 读取省界 Shapefile,创建要素图层(MakeFeatureLayer), + 对每个城市创建要素图层后使用 FeatureToPoint 计算几何中心点, + 再用 SelectLayerByLocation(WITHIN 关系)判断中心点是否在省界内。 + 输出分析结果 JSON 到 /tmp/output/result/。 + 预期结果:昆明、大理在省内通过;百色不在省内不通过。 + 注意:arcpy 步骤运行在 Python 2.7 环境。 runtime: arcpy script_id: arcpy_overlay depends_on: [geojson_to_shp] @@ -32,7 +75,12 @@ steps: output_dir: /tmp/output/result - id: export_excel - name: 输出 Excel + name: 输出 Excel 报表 + description: > + 读取叠加分析结果 JSON,用 openpyxl 生成格式化的 Excel 工作簿。 + 表头加粗白色字蓝色底色,数据行按"在省内"为是/否分别绿色/红色高亮。 + 写入用户指定的 output_path。 + 注意:此步骤使用 python3 运行时在 Windows 本机 Python 3 环境执行。 runtime: python3 script_id: excel depends_on: [overlay]