Files

109 lines
3.0 KiB
Markdown
Raw Permalink 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.
# TOOLS.md — 套件使用工具
## 市场前端
https://suites.mercator.cn
浏览套件、查看详情。
## 安装
### Linux
安装 `gis-actions` 包即可获得全部功能(CLI + 执行引擎),一次安装:
```bash
# 下载
curl -sLO https://packages.mercator.cn/public/gis-actions/latest.deb
# 安装
sudo dpkg -i latest.deb
```
安装后可用 `agc` 命令(已内置在包中)。
## 交流反馈
遇到任何问题或需要帮助,前往 https://discussions.mercator.cn/ 发话题。平台管理员和其他用户会在那里解答。
- **提问** — 使用 `question` 标签
- **报 Bug** — 使用 `bug` 标签
- **提建议** — 使用 `feature``suggestion` 标签
### Windows
1. 下载 [latest-windows.zip](https://packages.mercator.cn/public/gis-actions/latest-windows.zip)
2. 解压到 `%LOCALAPPDATA%\\AgentGIS\\gis-actions\\`
3.`%LOCALAPPDATA%\\AgentGIS\\gis-actions\\` 加入 `PATH`
4. 验证:`agc --help`
> Windows 版支持 **arcpy**(需要 ArcMap 10.8)和 **python3** 两种 runtime。
> 不依赖 Docker,直接在本地进程执行。
## 前提条件
- **Linux 系统**Debian / Ubuntu
- **Docker**(验证:`docker ps`,仅 Linux 版需要)
- **API Key** — 登录 https://auth.mercator.cn 获取,后续 `agc config set api_key <你的API Key>` 使用
### gis-base 基础镜像
Linux 版所有套件运行在 `gis-base` 镜像中(含 Python 3, GDAL, Shapely, GeoPandas, numpy, openpyxl, xlrd)。
Windows 版使用本地 Python 环境(arcpy 或 python3),不需要 Docker。
首次安装 gis-actions 时会自动下载镜像。也可提前手动准备:
```bash
# 从 Gitea 直接下载镜像包(无需 registry 账号)
curl -sLO https://packages.mercator.cn/public/gis-base/latest.tar.gz
docker load -i gis-base.tar.gz
```
## 执行套件
```bash
# 查询市场套件(通过 curl
curl -s https://suites.mercator.cn/api/v1/suites | python3 -m json.tool
# 执行套件,输入参数用 key=value 格式
agc run /tmp/output --suite-id <suite-id> --input key=value
```
`<suite-id>` 从市场 API 或前端页面获取。
## AI Agent 集成(MCP
GIS Actions 支持 MCPModel Context Protocol),AI Agent 可直接调用 GIS 工具:
```bash
# 启动 MCP Serverstdio 模式,供 Claude Desktop 等本地 Agent 使用)
agc mcp
# SSE 模式(HTTP,供远程 Agent 调用)
agc mcp --transport sse --port 8080
```
Agent 通过 MCP 协议自动发现可用套件并调用执行,无需人工介入。
## 数据流向
```
你本地的 SHP/GeoJSON/TIFF/XLS 文件
gis-actions(你的机器)
│ ← 从市场下载套件脚本包
│ ← docker run gis-base + 套件脚本
│ → 结果写入 /tmp/output/
结果文件(你的机器)
```
## 注意事项
- 输入文件路径使用你的本地绝对路径
- shapefile 需要传入目录路径而非单文件路径(因 .dbf/.shx 配套文件)
- 套件数据不上传云端,全部在你的机器上处理