92 lines
2.2 KiB
Markdown
92 lines
2.2 KiB
Markdown
# TOOLS.md — 套件使用工具
|
||
|
||
## 市场前端
|
||
|
||
https://suites.mercator.cn
|
||
|
||
浏览套件、查看详情。
|
||
|
||
## CLI 安装(gis-actions 本地执行器)
|
||
|
||
所有套件在你的机器上通过 Docker 本地执行,数据不上云。
|
||
|
||
安装 gis-actions 包即可获得 CLI + worker:
|
||
|
||
```bash
|
||
# 下载
|
||
curl -OJ https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.14/gis-actions_2.0.14_all.deb
|
||
|
||
# 安装
|
||
sudo dpkg -i gis-actions_2.0.14_all.deb
|
||
|
||
# 登录 Docker Registry(拉取 gis-base 镜像)
|
||
docker login registry.mercator.cn
|
||
```
|
||
|
||
## 前提条件
|
||
|
||
- Linux 系统(Debian / Ubuntu)
|
||
- Docker(验证:`docker ps`)
|
||
- 能访问 `registry.mercator.cn`
|
||
|
||
## 执行套件
|
||
|
||
```bash
|
||
SUITE_MARKET_URL="https://suites.mercator.cn" \
|
||
python3 /usr/share/gis-actions/cli.py run /tmp/work-output \
|
||
--suite-id <suite-id> \
|
||
--input bid_xls=/path/to/bid.xls \
|
||
--input points_shp=/path/to/points.shp
|
||
```
|
||
|
||
- `<suite-id>` 从 Suite Market 界面获取
|
||
- 输入文件路径用本地绝对路径,shapefile 只需传 .shp 路径,配套文件自动复制
|
||
- 支持 `--input key=value` 多参数传递
|
||
|
||
## 数据流向
|
||
|
||
```
|
||
你本地的 SHP/XLS 文件
|
||
│
|
||
▼
|
||
cli.py(你的机器)
|
||
│ ← 从市场下载套件脚本包
|
||
│ ← 复制输入文件到工作目录
|
||
│ → docker run gis-base + 套件脚本
|
||
│ → 结果写入 /tmp/output/
|
||
▼
|
||
结果文件(你的机器)
|
||
```
|
||
|
||
## 系统服务管理
|
||
|
||
```bash
|
||
# 查看状态
|
||
sudo systemctl status gis-actions
|
||
|
||
# 查看日志
|
||
journalctl -u gis-actions -f
|
||
|
||
# 停止
|
||
sudo systemctl stop gis-actions
|
||
```
|
||
|
||
## 快速上手(使用测试文件)
|
||
|
||
```bash
|
||
SUITE_MARKET_URL="https://suites.mercator.cn" \
|
||
python3 /usr/share/gis-actions/cli.py run /tmp/my-output \
|
||
--suite-id 2c99a1cb-84a5-42dd-9147-1c8e8f7f2941 \
|
||
--input bid_xls=/path/to/标段清单.xls \
|
||
--input points_shp=/path/to/点状工程.shp \
|
||
--input lines_shp=/path/to/线性工程.shp \
|
||
--input polygons_shp=/path/to/面状工程.shp
|
||
```
|
||
|
||
## 注意事项
|
||
|
||
1. 先安装 gis-actions(含 cli.py)
|
||
2. `docker login registry.mercator.cn` 确保能拉镜像
|
||
3. 从 Suite Market 获取 suite id
|
||
4. 执行:`python3 /usr/share/gis-actions/cli.py run ... --input key=value`
|