@dsh-gis/dsh-opengis-skill 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +31 -0
- package/README.md +43 -33
- package/assets/cesiumjs/SKILL.md +11 -12
- package/assets/deck-gl/SKILL.md +10 -9
- package/assets/gdal/SKILL.md +10 -44
- package/assets/gdal-api/SKILL.md +10 -29
- package/assets/geometry-api-java/SKILL.md +10 -17
- package/assets/geometry-api-net/SKILL.md +10 -17
- package/assets/geopandas/SKILL.md +10 -18
- package/assets/geopipe-agent/SKILL.md +10 -20
- package/assets/geoserver/SKILL.md +20 -25
- package/assets/geoserver-cloud/SKILL.md +14 -24
- package/assets/geoserver-rest-api/SKILL.md +10 -20
- package/assets/geotools/SKILL.md +11 -21
- package/assets/grass-gis/SKILL.md +9 -9
- package/assets/jts/SKILL.md +9 -17
- package/assets/leaflet/SKILL.md +10 -7
- package/assets/mapbox-gl-js/SKILL.md +10 -8
- package/assets/mapserver/SKILL.md +9 -7
- package/assets/mapsui/SKILL.md +10 -18
- package/assets/nettopologysuite/SKILL.md +15 -17
- package/assets/opengis-all/SKILL.md +10 -30
- package/assets/opengis-daf/SKILL.md +10 -13
- package/assets/opengis-utils-for-java/SKILL.md +10 -18
- package/assets/opengis-utils-for-net/SKILL.md +10 -10
- package/assets/openlayers/SKILL.md +10 -10
- package/assets/pdal/SKILL.md +9 -7
- package/assets/postgis/SKILL.md +10 -12
- package/assets/proj/SKILL.md +9 -20
- package/assets/pyqgis/SKILL.md +9 -43
- package/assets/qgis-process/SKILL.md +10 -31
- package/assets/qgis-server/SKILL.md +9 -20
- package/assets/shapely/SKILL.md +10 -18
- package/assets/sharpmap/SKILL.md +9 -17
- package/package.json +1 -1
- package/upstream.json +34 -34
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geopipe-agent
|
|
3
|
-
description: "Use when building
|
|
3
|
+
description: "Use when building YAML GIS pipelines with GeoPipeAgent — geopipe-agent validate/run, io.read_vector → vector.buffer → io.write_vector chains, 33 built-in steps, qc.geometry_validity/attribute_completeness/topology, native_python|qgis_process|gdal_cli backends, $step.output refs; also for validate \"not registered\" errors, silent when-condition skips, and resolve/knowledge capability gaps. 0.1.0, source install only (not on PyPI)."
|
|
4
4
|
tags:
|
|
5
5
|
- gis
|
|
6
6
|
- agent
|
|
@@ -247,26 +247,16 @@ QC 步骤遵循 **「检查即透传」** 模式:输入数据原样通过为 `
|
|
|
247
247
|
| 网络分析 | `io.read_vector → network.shortest_path → network.service_area → io.write_vector ×2` |
|
|
248
248
|
| 空间聚类 + 热力图 | `io.read_vector → analysis.cluster(dbscan) → analysis.heatmap → io.write_vector + io.write_raster` |
|
|
249
249
|
|
|
250
|
-
##
|
|
250
|
+
## DeepSeek Harness 使用建议
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
### 关键注意事项
|
|
262
|
-
|
|
263
|
-
- **步骤 ID 规则**:只能用小写字母、数字、下划线和连字符,不能含点号(`.` 保留用于属性引用)
|
|
264
|
-
- **引用链完整性**:确保每个 `$step_id` 引用的步骤在当前步骤之前定义
|
|
265
|
-
- **QC 链式调用**:QC 步骤可串联(如 `qc.geometry_validity → qc.attribute_completeness → qc.topology`),问题汇总到管道报告的 `qc_summary` 中;请使用 `geopipe-agent list-steps --category qc` 列出的真实步骤 ID,写错 ID 会导致校验失败
|
|
266
|
-
- **后端选择**:默认 `native_python`(纯 Python,无外部依赖);可在步骤上用 `backend: <名称>` 指定 gdal_cli / gdal_python / qgis_process / pyqgis / generic_cli / curl_api,用 `geopipe-agent backends` 查看当前环境可用后端。注意:**只有声明了 backends 的步骤会读取该字段**(当前为 6 个矢量步骤),其余步骤写 `backend:` 会被忽略
|
|
267
|
-
- **路径使用绝对路径**:避免工作目录问题
|
|
268
|
-
- **未实现的能力**:若某个步骤 ID 尚未实现,`validate` 会直接报错;此时不要猜测参数,改用 `geopipe-agent resolve "<需求>"` 获取候选能力与回退路径
|
|
269
|
-
- **大数据注意**:管道在内存中运行,超大栅格建议先裁剪
|
|
252
|
+
- **加载与引用**:用 `skill("geopipe-agent")` 加载(用户也可输入 `/geopipe-agent`);`reference/steps-reference.md`、`pipeline-schema.md`、`workflows.md`、`self-extension.md` 按需 `read`,路径相对加载结果中的 Base directory;技能目录只读,YAML 与输出写到会话工作区。
|
|
253
|
+
- **执行环境**:命令交给 dsh 的 shell 工具(Windows 用 `pwsh`);`python` 可能指向 QGIS/GDAL 自带解释器,建议在工作区建独立 venv 后 `pip install -e .`,避免污染系统环境。
|
|
254
|
+
- **源码安装(未上 PyPI)**:`git clone https://github.com/znlgis/GeoPipeAgent.git && pip install -e ".[analysis,network]"`;验证 `geopipe-agent --help`、`geopipe-agent list-steps --category qc`、`pip show geopipe-agent | Select-String Version`。不要写 `pip install geopipe-agent`——PyPI 上还没有这个包。
|
|
255
|
+
- **先探测能力**:`geopipe-agent backends` 看当前环境可用后端(默认 `native_python`),`geopipe-agent list-steps --format json` 拿真实步骤 ID;`validate` 报 `not registered` 时先用 `geopipe-agent resolve "<需求>"` 与 `knowledge search`,不要猜参数。
|
|
256
|
+
- **验证产物**:`geopipe-agent validate pipeline.yaml` 通过后再 `run pipeline.yaml`,检查 JSON 报告里的 `qc_summary` 与各步骤统计,随后重开输出文件核对(`geopipe-agent info output/result.geojson`,装了 GDAL 时也可 `ogrinfo -so output/result.geojson result`),确认要素数与 CRS 而不是只看“执行成功”。
|
|
257
|
+
- **典型误操**:步骤 ID 不能含点号,`$step_id` 必须由更早步骤提供,`when` 引用不存在的属性会按 false **静默跳过**;`backend:` 只有声明了 backends 的 6 个矢量步骤会读取,其余步骤写了也被忽略。
|
|
258
|
+
- **性能与内存**:管道全程在内存中运行,超大栅格先 `raster.clip` 或 `io.read_raster` 只读所需波段;QC 步骤是“检查即透传”,`output` 就是输入,问题在 `$step.issues` / `issues_gdf`。
|
|
259
|
+
- **安全与权限**:`network.geocode` 与 `curl_api`、`http.request` 会把数据发到外部服务,执行前确认是否允许出网并检查 `user_agent`/凭据;`pip install`、覆盖已有输出文件、批量改写数据前先征得用户同意。
|
|
270
260
|
|
|
271
261
|
---
|
|
272
262
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geoserver
|
|
3
|
-
description: "Use when deploying
|
|
3
|
+
description: "Use when deploying GeoServer 3.0.x to publish WMS/WFS/WMTS/WCS/MVT, or configuring SLD/CSS styles, RBAC security, and GeoWebCache seeding. Covers geoserver-3.0.2-bin.zip, docker.osgeo.org/geoserver:3.0.2 on Java 17/21, /rest/about/version.json, blank GetMap from wrong native bounds, and Shapefile charset mojibake."
|
|
4
4
|
tags:
|
|
5
5
|
- java
|
|
6
6
|
- server
|
|
@@ -20,7 +20,9 @@ tags:
|
|
|
20
20
|
>
|
|
21
21
|
> **下载:** <https://geoserver.org/release/stable/>
|
|
22
22
|
>
|
|
23
|
-
> **最新版本:** 3.0.
|
|
23
|
+
> **最新版本:** 3.0.2(2026-10-19,安全修复版,生产应优先升级;[官方下载](https://geoserver.org/release/stable/))
|
|
24
|
+
>
|
|
25
|
+
> **运行环境:** Java 17 或 21;3.0.2 内含 GeoTools 35.2、GeoWebCache 2.0.2
|
|
24
26
|
>
|
|
25
27
|
> **许可证:** GPL-2.0
|
|
26
28
|
|
|
@@ -41,11 +43,15 @@ GeoServer 提供:
|
|
|
41
43
|
|
|
42
44
|
## 安装部署
|
|
43
45
|
|
|
46
|
+
### 前置:JDK
|
|
47
|
+
|
|
48
|
+
3.0.x 需要 **Java 17 或 21**;先 `java -version` 确认(低于 17 的 JVM 无法启动 3.x 分发包)。
|
|
49
|
+
|
|
44
50
|
### 二进制
|
|
45
51
|
|
|
46
52
|
```bash
|
|
47
|
-
|
|
48
|
-
unzip geoserver-3.0.
|
|
53
|
+
curl -fLO https://sourceforge.net/projects/geoserver/files/GeoServer/3.0.2/geoserver-3.0.2-bin.zip
|
|
54
|
+
unzip geoserver-3.0.2-bin.zip && cd geoserver-3.0.2
|
|
49
55
|
sh bin/startup.sh # http://localhost:8080/geoserver (admin/geoserver)
|
|
50
56
|
```
|
|
51
57
|
|
|
@@ -56,7 +62,7 @@ docker run --name gs -p 8080:8080 \
|
|
|
56
62
|
-e SKIP_DEMO_DATA=true \
|
|
57
63
|
-e EXTRA_JAVA_OPTS="-Xms512m -Xmx2g" \
|
|
58
64
|
-v $PWD/data:/opt/geoserver_data \
|
|
59
|
-
docker.osgeo.org/geoserver:3.0.
|
|
65
|
+
docker.osgeo.org/geoserver:3.0.2
|
|
60
66
|
```
|
|
61
67
|
|
|
62
68
|
### 数据目录
|
|
@@ -169,7 +175,7 @@ curl -u admin:geoserver -XPOST \
|
|
|
169
175
|
|
|
170
176
|
## 典型工作流
|
|
171
177
|
|
|
172
|
-
1. **部署 GeoServer**:优先使用 Docker 镜像 `docker.osgeo.org/geoserver:3.0.
|
|
178
|
+
1. **部署 GeoServer**:优先使用 Docker 镜像 `docker.osgeo.org/geoserver:3.0.2`(安全修复版;从旧版本升级前先备份数据目录)
|
|
173
179
|
2. **创建 Workspace**:为每个项目创建独立工作空间实现命名隔离
|
|
174
180
|
3. **添加数据存储**:根据数据类型选择 PostGIS(矢量)、Shapefile(文件矢量)、GeoTIFF(栅格)
|
|
175
181
|
4. **发布图层**:设置 SRS(坐标参考系)、计算 Native Bounds、配置样式
|
|
@@ -202,26 +208,15 @@ curl -u admin:geoserver -XPOST \
|
|
|
202
208
|
|
|
203
209
|
---
|
|
204
210
|
|
|
205
|
-
##
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
### 关键注意事项
|
|
211
|
+
## DeepSeek Harness 使用建议
|
|
209
212
|
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
-
|
|
214
|
-
-
|
|
215
|
-
-
|
|
216
|
-
|
|
217
|
-
### 常见配置模式
|
|
218
|
-
|
|
219
|
-
```text
|
|
220
|
-
工作空间(Workspace)
|
|
221
|
-
├── 数据存储(Store) ─→ PostGIS / Shapefile / GeoTIFF
|
|
222
|
-
│ └── 图层(Layer) ─→ 设置 SRS + 绑定样式(Style)
|
|
223
|
-
└── 图层组(LayerGroup) ─→ 组合多个图层统一发布
|
|
224
|
-
```
|
|
213
|
+
- **加载与引用**:`skill("geoserver")` 加载;技能目录只读,SLD、脚本、日志等产物写到会话工作区。
|
|
214
|
+
- **执行环境**:命令交给 dsh 的 shell 工具(Windows 用 `pwsh`);`wget`/`unzip` 换成 `curl.exe -LO` 与 `Expand-Archive`,`$PWD` 换成 `(Get-Location)`。
|
|
215
|
+
- **先探测版本**:`curl -s -u admin:geoserver http://localhost:8080/geoserver/rest/about/version.json`(无 jq 时管道给 `python -m json.tool`),核对 GeoServer、GeoWebCache 与 JVM;`java -version` 必须是 17 或 21,否则 3.0.2 包直接启动失败。
|
|
216
|
+
- **验证产物**:发布后用 `curl -s -o out.png -w "%{http_code} %{size_download}\n" "http://localhost:8080/geoserver/my_ws/wms?service=WMS&version=1.1.0&request=GetMap&layers=my_ws:poi&srs=EPSG:4326&bbox=...&width=512&height=512&format=image/png"`,要 200 且字节数大于 0;再拉一次 `GetCapabilities` 确认图层已注册,不要只凭 UI 回显。
|
|
217
|
+
- **写后回读**:REST 建 workspace/store/layer 或上传 SLD 后,用同路径 GET 回读;`?recurse=true` 删除后再 GET 应得 404。
|
|
218
|
+
- **安全与权限**:`admin:geoserver` 凭据不要回显到命令输出或报告里(用环境变量传入);重启容器、改 `-Xmx`、删除 workspace、清 GWC 缓存前先征得用户同意。
|
|
219
|
+
- **常见误操作**:WMS 返回空白图先查 native bounds 与 SRS 是否对不上;Shapefile 中文乱码改 Store 的 `charset`;seed 大范围瓦片会撑爆磁盘,先小 zoom 范围试。
|
|
225
220
|
|
|
226
221
|
## 相关技能
|
|
227
222
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geoserver-cloud
|
|
3
|
-
description: "Use when deploying GeoServer on Kubernetes
|
|
3
|
+
description: "Use when deploying GeoServer Cloud 3.0.2 on Docker Compose or Kubernetes — gateway serving WMS/WFS/WCS/WPS/GWC microservices under /geoserver/cloud, PgConfig vs datadir backends, RabbitMQ config-bus sync, Helm chart geoservercloud 3.0.2, and diagnosing 502s via actuator/health and Consul registration."
|
|
4
4
|
tags:
|
|
5
5
|
- java
|
|
6
6
|
- server
|
|
@@ -18,9 +18,9 @@ tags:
|
|
|
18
18
|
>
|
|
19
19
|
> **官方文档:** <https://geoserver.org/geoserver-cloud/>
|
|
20
20
|
>
|
|
21
|
-
> **Docker Hub:** <https://hub.docker.com/u/geoservercloud>(镜像标签与 GeoServer 主版本对应,如 `3.0.
|
|
21
|
+
> **Docker Hub:** <https://hub.docker.com/u/geoservercloud>(镜像标签与 GeoServer 主版本对应,如 `3.0.2`)
|
|
22
22
|
>
|
|
23
|
-
> **最新版本:** 3.0.
|
|
23
|
+
> **最新版本:** 3.0.2(2026-10-20,[GitHub Releases](https://github.com/geoserver/geoserver-cloud/releases))
|
|
24
24
|
>
|
|
25
25
|
> **许可证:** GPL-2.0
|
|
26
26
|
|
|
@@ -98,7 +98,7 @@ PGCONFIG_SCHEMA: "pgconfig" # 启动时自动创建 schema
|
|
|
98
98
|
## Kubernetes(Helm)
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
|
-
# Chart:camptocamp/helm-geoserver-cloud(chart 名 geoservercloud,最新 3.0.
|
|
101
|
+
# Chart:camptocamp/helm-geoserver-cloud(chart 名 geoservercloud,最新 3.0.2)
|
|
102
102
|
helm repo add geoserver-cloud https://camptocamp.github.io/helm-geoserver-cloud
|
|
103
103
|
helm repo update
|
|
104
104
|
```
|
|
@@ -110,7 +110,7 @@ helm repo update
|
|
|
110
110
|
> dependencies:
|
|
111
111
|
> - name: geoservercloud
|
|
112
112
|
> repository: https://camptocamp.github.io/helm-geoserver-cloud
|
|
113
|
-
> version: 3.0.
|
|
113
|
+
> version: 3.0.2
|
|
114
114
|
> ```
|
|
115
115
|
>
|
|
116
116
|
> ```yaml
|
|
@@ -182,7 +182,7 @@ management:
|
|
|
182
182
|
```bash
|
|
183
183
|
docker run -e SPRING_PROFILES_ACTIVE=datadir \
|
|
184
184
|
-v /mnt/gsdata:/opt/app/data_directory \
|
|
185
|
-
geoservercloud/geoserver-cloud-wms:3.0.
|
|
185
|
+
geoservercloud/geoserver-cloud-wms:3.0.2
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
---
|
|
@@ -247,25 +247,15 @@ kubectl -n gis get deploy | grep wms
|
|
|
247
247
|
kubectl -n gis scale deploy <wms-deployment> --replicas=10
|
|
248
248
|
```
|
|
249
249
|
|
|
250
|
-
##
|
|
250
|
+
## DeepSeek Harness 使用建议
|
|
251
251
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
6. **弹性伸缩**:按负载独立扩缩 WMS/WFS 等服务的副本数
|
|
260
|
-
|
|
261
|
-
### 关键注意事项
|
|
262
|
-
|
|
263
|
-
- **启动顺序**:先启动 discovery/Consul → config → 数据库/RabbitMQ → 各业务服务
|
|
264
|
-
- **配置同步**:确保 `GEOSERVER_BUS_ENABLED=true` 且 RabbitMQ 可达
|
|
265
|
-
- **路径前缀**:默认 `GEOSERVER_BASE_PATH=/geoserver/cloud`,构造服务 URL 时不要漏掉
|
|
266
|
-
- **PgConfig 一致性**:多副本共享同一个 PgConfig 数据库实现强一致
|
|
267
|
-
- **JVM 独立调优**:每个微服务根据负载独立设置 `-Xmx`,避免 OOM
|
|
268
|
-
- **不部署不需要的服务**:如不使用 WPS/WCS,直接从 docker-compose 中移除
|
|
252
|
+
- **加载与引用**:`skill("geoserver-cloud")` 加载;技能目录只读,compose/values 覆写文件写到会话工作区。
|
|
253
|
+
- **执行环境**:命令交给 dsh 的 `pwsh`(Windows 无 `wget`,改 `curl.exe -LO`);先用 `docker version`、`helm version`、`kubectl version --client` 确认工具在 PATH。
|
|
254
|
+
- **先探测版本**:`curl.exe -s -u admin:geoserver http://localhost:9090/geoserver/cloud/rest/about/version.json` 读 GeoServer 版本;`curl.exe -s http://localhost:9090/actuator/health` 取 `{"status":"UP"}`(被 profile 关掉时改用 `kubectl -n gis get pods` 判活)。
|
|
255
|
+
- **验证产物**:部署后逐服务探活,再经网关 `.../rest/workspaces.json` 与一次 WMS `GetMap` 走通全链路;`docker compose ps` 显示 Up 不等于 OGC 服务可用。
|
|
256
|
+
- **排障顺序**:502 → 查 Consul 注册与目标服务健康(`kubectl -n gis logs deploy/<wms>`);配置不生效 → 查 RabbitMQ 与 `GEOSERVER_BUS_ENABLED`;瓦片 404 → 查 gwc 是否部署、`GEOSERVER_BASE_PATH` 前缀是否一致。
|
|
257
|
+
- **安全与权限**:`admin:geoserver`、`PGCONFIG_PASSWORD`、RabbitMQ 口令不要回显到报告;`docker compose down -v`、`helm uninstall`、删 PVC 或 PgConfig schema 会丢配置,先向用户确认并备份。
|
|
258
|
+
- **先本地复现**:能在 docker compose 复现的问题再上 K8s;镜像标签与 chart 版本保持同一版本号(3.0.2),避免网关与服务错配。
|
|
269
259
|
|
|
270
260
|
## 相关技能
|
|
271
261
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geoserver-rest-api
|
|
3
|
-
description: "Use when automating GeoServer
|
|
3
|
+
description: "Use when automating GeoServer 3.0.2 over REST — POST /rest/workspaces, datastores, featuretypes, PUT Shapefile ZIP to file.shp, GeoTIFF to coveragestores, upload SLD as application/vnd.ogc.sld+xml, ?recurse=true deletes. curl -u admin:geoserver, single-key JSON like {\"workspace\":{...}}, 401 on POST but 200 on GET, GWC cache masking style changes."
|
|
4
4
|
tags:
|
|
5
5
|
- rest
|
|
6
6
|
- api
|
|
@@ -20,7 +20,7 @@ tags:
|
|
|
20
20
|
>
|
|
21
21
|
> **API 参考:** <https://docs.geoserver.org/stable/en/user/rest/api/index.html>
|
|
22
22
|
>
|
|
23
|
-
> **最新版本:** GeoServer 3.0.
|
|
23
|
+
> **最新版本:** GeoServer 3.0.2(2026-10-19,安全修复版;[官方下载](https://geoserver.org/release/stable/))
|
|
24
24
|
>
|
|
25
25
|
> **许可证:** GPL-2.0
|
|
26
26
|
|
|
@@ -354,25 +354,15 @@ await workspaceService.CreateWorkspaceAsync("myws");
|
|
|
354
354
|
|
|
355
355
|
---
|
|
356
356
|
|
|
357
|
-
##
|
|
357
|
+
## DeepSeek Harness 使用建议
|
|
358
358
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
6. **验证发布**:GET `/rest/layers.json` 确认图层列表,访问 WMS GetMap 测试
|
|
367
|
-
|
|
368
|
-
### 关键注意事项
|
|
369
|
-
|
|
370
|
-
- **JSON 包装结构**:GeoServer REST API 的 JSON 请求/响应使用单层包装(如 `{"workspace":{...}}`)
|
|
371
|
-
- **recurse 参数**:删除 Workspace/Store 时务必添加 `?recurse=true` 级联删除
|
|
372
|
-
- **Shapefile 上传**:必须打包为 ZIP(含 .shp/.shx/.dbf/.prj),用 PUT 方式上传
|
|
373
|
-
- **URL 后缀**:可用 `.json` / `.xml` 后缀替代 `Accept` 头指定响应格式
|
|
374
|
-
- **Content-Type**:样式上传使用 `application/vnd.ogc.sld+xml`,栅格上传使用 `image/tiff`
|
|
375
|
-
- **认证**:所有 POST/PUT/DELETE 操作需要 HTTP Basic Auth(默认 admin:geoserver)
|
|
359
|
+
- **加载与引用**:`skill("geoserver-rest-api")` 加载;完整端点清单按需 `read` [reference/endpoints.md](reference/endpoints.md)(路径相对技能 Base directory),不要整份通读。
|
|
360
|
+
- **执行环境**:示例交给 dsh 的 `pwsh`(显式 `curl.exe`,Windows 的 `curl` 是别名、参数不同);`\` 续行在 pwsh 无效,压成单行;请求体先写成 `body.json`,用 `curl.exe --data "@body.json"` 传,避开各 shell 的引号差异。
|
|
361
|
+
- **先探测版本**:`curl.exe -s -u admin:geoserver http://localhost:8080/geoserver/rest/about/version.json`,确认是 3.0.2 并顺带看到组件版本;返回 401 是凭据/安全规则问题,不是版本问题。
|
|
362
|
+
- **验证产物**:写操作后立刻 GET 回读同一资源(`.../rest/workspaces/myws.json`、`.../rest/layers/myws:roads.json`),再发一次 WMS `GetMap` 取 `image/png` 确认非空图;不要只凭 201 或退出码报告成功。
|
|
363
|
+
- **幂等与坑**:同名资源重复 POST 会报已存在(重跑脚本前先 GET 判断或改 PUT);改了样式记得清 GWC 缓存,否则瓦片还是旧的。
|
|
364
|
+
- **安全与权限**:`admin:geoserver` 不要硬编码进脚本或回显到报告;`?recurse=true` 删除 workspace、`POST /rest/reset`、清缓存均不可逆,执行前向用户确认。
|
|
365
|
+
- **批量脚本**:循环建资源时检查 `$LASTEXITCODE`,一失败即停;半套配置留在服务端比报错更难排查。
|
|
376
366
|
|
|
377
367
|
## 相关技能
|
|
378
368
|
|
package/assets/geotools/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geotools
|
|
3
|
-
description: "Use when building Java GIS
|
|
3
|
+
description: "Use when building Java GIS apps on GeoTools 35.2 (JDK 17) — org.geotools:gt-main / gt-shapefile / gt-geopkg / gt-epsg-hsql from repo.osgeo.org (not Maven Central), CQL/ECQL filters, CRS.decode plus JTS.transform reprojection, StreamingRenderer PNG output, and disposing DataStore/SimpleFeatureIterator."
|
|
4
4
|
tags:
|
|
5
5
|
- java
|
|
6
6
|
- gis
|
|
@@ -18,7 +18,7 @@ tags:
|
|
|
18
18
|
>
|
|
19
19
|
> **Maven GroupId:** `org.geotools`
|
|
20
20
|
>
|
|
21
|
-
> **最新版本:** 35.
|
|
21
|
+
> **最新版本:** 35.2(2026-10-16,[OSGeo Maven 仓库](https://repo.osgeo.org/repository/release/))
|
|
22
22
|
>
|
|
23
23
|
> **许可证:** LGPL 2.1
|
|
24
24
|
>
|
|
@@ -60,7 +60,7 @@ GeoTools 发布在 OSGeo Maven 仓库,需在 `pom.xml` 中添加:
|
|
|
60
60
|
|
|
61
61
|
```xml
|
|
62
62
|
<properties>
|
|
63
|
-
<geotools.version>35.
|
|
63
|
+
<geotools.version>35.2</geotools.version><!-- 最新稳定版;版本列表见 https://geotools.org/ -->
|
|
64
64
|
</properties>
|
|
65
65
|
|
|
66
66
|
<dependencies>
|
|
@@ -386,25 +386,15 @@ store.dispose();
|
|
|
386
386
|
|
|
387
387
|
---
|
|
388
388
|
|
|
389
|
-
##
|
|
389
|
+
## DeepSeek Harness 使用建议
|
|
390
390
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
6. **释放资源**:`store.dispose()`、关闭 `SimpleFeatureIterator`
|
|
399
|
-
|
|
400
|
-
### 关键注意事项
|
|
401
|
-
|
|
402
|
-
- **Maven 仓库必需**:GeoTools 不在 Maven Central,必须配置 OSGeo 仓库
|
|
403
|
-
- **EPSG 数据库**:使用 CRS 功能需引入 `gt-epsg-hsql`,否则 `CRS.decode()` 抛出异常
|
|
404
|
-
- **资源释放**:`DataStore`、`Reader`、`Writer`、`MapContent` 使用后必须调用 `dispose()`
|
|
405
|
-
- **坐标轴顺序**:GeoTools 默认遵循 EPSG 规范(纬度在前),使用 `CRS.decode("EPSG:4326", true)` 强制经度在前
|
|
406
|
-
- **线程安全**:`DataStore` 线程安全可共享;`SimpleFeatureIterator` 非线程安全
|
|
407
|
-
- **JTS 包名**:GeoTools 20+ 使用 `org.locationtech.jts`(GeoTools ≤19 为旧版 `com.vividsolutions.jts`)
|
|
391
|
+
- **加载与引用**:`skill("geotools")` 加载;完整示例在 [reference/vector-io.md](reference/vector-io.md) 与 [reference/raster-rendering.md](reference/raster-rendering.md),按需 `read`(路径相对技能 Base directory)。
|
|
392
|
+
- **执行环境**:命令交给 dsh 的 `pwsh`;先 `java -version` 与 `mvn -v` 确认 JDK 17,35.x 在 JDK 8/11 下编译即失败。
|
|
393
|
+
- **先探测版本**:`mvn dependency:tree -Dincludes=org.geotools` 确认解析到 35.2 且未被其他依赖压回旧版;`pom.xml` 里必须有指向 `repo.osgeo.org/repository/release/` 的 `<repository>`。
|
|
394
|
+
- **验证产物**:`mvn -q -DskipTests package` 后跑最小读图层程序(`FileDataStoreFinder` → `getFeatures()` → 打印 count 与 CRS)或 `mvn -q test`;`CRS.decode("EPSG:4326")` 抛异常说明缺 `gt-epsg-hsql`。
|
|
395
|
+
- **常见失败信号**:`getDataStore()` 返回 null 或报找不到工厂,是 SPI 模块没进 classpath;出现 `com.vividsolutions.jts` 是包名没升级(GeoTools 20+ 用 `org.locationtech.jts`)。
|
|
396
|
+
- **安全与权限**:测试别全量加载要素到内存(用 `Query` 限制属性与 bbox);连接串/密码不要回显,对生产库批量写入前先向用户确认。
|
|
397
|
+
- **按需读文件**:本 SKILL 较长,先按章节标题定位,再用 `read` 的 offset/limit 只取相关段,避免整篇占满上下文。
|
|
408
398
|
|
|
409
399
|
## 相关技能
|
|
410
400
|
|
|
@@ -328,12 +328,12 @@ grass $HOME/grassdata/ndvi_project/PERMANENT --exec sh -c '
|
|
|
328
328
|
- **geopandas** — Python 矢量数据分析:[../geopandas/SKILL.md](../geopandas/SKILL.md)
|
|
329
329
|
- **pyqgis** — QGIS Python 绑定:[../pyqgis/SKILL.md](../pyqgis/SKILL.md)
|
|
330
330
|
|
|
331
|
-
##
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
331
|
+
## DeepSeek Harness 使用建议
|
|
332
|
+
|
|
333
|
+
- **加载与引用**:用 `skill("grass-gis")` 加载(用户也可输入 `/grass-gis`);本技能没有 reference 子目录,模块参数用 `r.univar --help` 或官网手册核对;技能目录只读,脚本与导出结果写到会话工作区。
|
|
334
|
+
- **执行环境**:命令交给 dsh 的 shell 工具(Windows 用 `pwsh`;仅暴露 `run_code` 的会话在 `tools.pwsh` 中执行)。正文里 `grass ... --exec sh -c '...'` 的多行引用在 pwsh 下不可靠,改为把模块序列写进 `.py` 脚本(首行 `#!/usr/bin/env python3`),再 `grass --tmp-project EPSG:3857 --exec python3 analysis.py`。
|
|
335
|
+
- **先探测版本**:`grass --version`(应为 8.5.0,LTR 8.4.2)、`grass --tmp-project EPSG:3857 --exec g.region -p`;8.4 之前没有 `grass.tools`,Python 脚本改用 `gs.run_command`。
|
|
336
|
+
- **验证产物**:`--tmp-project` 内的地图最后必须导出——`r.out.gdal input=slope output=/work/slope.tif format=GTiff`,随后 `gdalinfo -json slope.tif` 核对 CRS 与范围;会话内核对用 `g.region -p format=json`、`g.list type=raster`。
|
|
337
|
+
- **区域语义优先**:栅格模块只处理计算区域内的像元,结果范围不对先看 `g.region -p`;重复运行加 `--overwrite`,否则模块报地图已存在并非零退出。
|
|
338
|
+
- **错误识别**:GRASS 模块的失败以 `ERROR:` 开头并返回非零码(如 `Raster map <x> not found`),据此区分地图名、区域为空还是输出已存在问题,不要只读最后一行日志。
|
|
339
|
+
- **安全与权限**:`g.remove`、`--overwrite`、`t.connect` 会改/删地图集数据;`--tmp-project`/`--tmp-mapset` 结束即删除目录,结果必须先导出;启动 Docker 或改文件属主(`--user=$(id -u):$(id -g)`)前先确认写入路径。
|
package/assets/jts/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: jts
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when doing precise 2D computational geometry in Java with org.locationtech.jts:jts-core 1.20.0 — GeometryFactory construction, contains/intersects predicates, overlay via OverlayNGRobust, buffer, STRtree and PreparedGeometry speedups, WKT/WKB/GeoJSON I/O, and fixing TopologyException or unclosed rings."
|
|
4
4
|
|
|
5
5
|
tags:
|
|
6
6
|
- java
|
|
@@ -251,23 +251,15 @@ String geoJson = new GeoJsonWriter().write(buffered);
|
|
|
251
251
|
|
|
252
252
|
---
|
|
253
253
|
|
|
254
|
-
##
|
|
254
|
+
## DeepSeek Harness 使用建议
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
1.
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
### 关键注意事项
|
|
265
|
-
|
|
266
|
-
- **坐标顺序**:JTS 使用 `(x, y)` 即 `(经度, 纬度)`,注意与部分 GIS 系统的 `(y, x)` 区分
|
|
267
|
-
- **SRID 不参与计算**:JTS 所有计算在笛卡尔平面进行,不处理地球曲率
|
|
268
|
-
- **OverlayNG 优先**:叠加运算优先使用 `OverlayNGRobust.overlay()`,比传统方法更鲁棒
|
|
269
|
-
- **线程安全**:`GeometryFactory` 和 `Geometry` 线程安全;Reader/Writer 非线程安全
|
|
270
|
-
- **有效性检查**:外部导入的几何用 `isValid()` 检查后用 `GeometryFixer.fix()` 修复
|
|
256
|
+
- **加载与引用**:`skill("jts")` 加载;完整运算示例在 [reference/geometry-operations.md](reference/geometry-operations.md),按需 `read`(路径相对技能 Base directory)。
|
|
257
|
+
- **执行环境**:命令交给 dsh 的 `pwsh`;JTS 只依赖 `jts-core`,Maven Central 直接可解析,不需要额外仓库,JDK 8+ 即可。
|
|
258
|
+
- **先探测版本**:`mvn dependency:tree -Dincludes=org.locationtech.jts` 确认解析到 1.20.0;同时确认 classpath 里没有遗留的 `com.vividsolutions.jts` 旧包。
|
|
259
|
+
- **验证产物**:`mvn -q test`,或最小 main 做 WKT 往返 + `geom.isValid()` + `buffer(0)` 断言;导出 GeoJSON 后用 `GeoJsonReader` 读回比对坐标数,别只看日志。
|
|
260
|
+
- **失败信号**:`TopologyException` 改用 `OverlayNGRobust.overlay()`;`isValid()` 为 false 先 `GeometryFixer.fix()`;结果为空多半是把坐标写成了 `(lat, lon)`。
|
|
261
|
+
- **注意事项**:SRID 在 JTS 里只是元数据、计算全在笛卡尔平面,跨投影需自己先转换;`WKTReader`/`WKTWriter` 非线程安全,不要多线程共享。
|
|
262
|
+
- **性能验证**:批量判断用 `PreparedGeometry` 前后各计时一次(`System.nanoTime()`),用数据证明优化有效,别凭感觉。
|
|
271
263
|
|
|
272
264
|
## 相关技能
|
|
273
265
|
|
package/assets/leaflet/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: leaflet
|
|
3
|
-
description: "Use when adding lightweight
|
|
3
|
+
description: "Use when adding lightweight 2D tile maps to web pages with leaflet 1.9.4 — L.map/L.tileLayer, markers, popups, GeoJSON overlays, layer control, [lat, lng] ordering, or debugging blank maps, broken default marker icons after bundling, and sizing fixed by invalidateSize()."
|
|
4
4
|
tags:
|
|
5
5
|
- javascript
|
|
6
6
|
- web
|
|
@@ -341,10 +341,13 @@ export default function MapView() {
|
|
|
341
341
|
- **cesiumjs** — 三维地球与 3D Tiles 可视化:[../cesiumjs/SKILL.md](../cesiumjs/SKILL.md)
|
|
342
342
|
- **geoserver** — 发布 WMS/WFS/瓦片服务作为 Leaflet 数据源:[../geoserver/SKILL.md](../geoserver/SKILL.md)
|
|
343
343
|
|
|
344
|
-
##
|
|
344
|
+
## DeepSeek Harness 使用建议
|
|
345
345
|
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
346
|
+
- **加载与引用**:用 `skill("leaflet")` 加载(用户也可输入 `/leaflet`);本技能无 reference 子目录,示例代码直接落到会话工作区工程,技能目录只读。
|
|
347
|
+
- **执行环境**:`npm install`、`npm run build` 交给 `pwsh`;纯静态页面可用 `python -m http.server 5173` 起服务(`python` 不存在时用 `py -3`)。
|
|
348
|
+
- **先探测版本**:`npm ls leaflet`(未装则 `npm view leaflet version`);本技能按 1.9.4 编写,CDN 的 `integrity` SRI 哈希只对应 1.9.4,换版本必须同步换哈希。
|
|
349
|
+
- **验证产物**:构建后 `curl.exe -I http://localhost:5173/assets/<入口>.js` 确认 200;联网时还可 `curl.exe -I https://unpkg.com/leaflet@1.9.4/dist/leaflet.js` 核对 CDN 版本;DSH 不打开浏览器,把 URL 和“应看到瓦片与标记”交给用户,有截图再用 `read_image`。
|
|
350
|
+
- **图标与坐标**:npm + 打包器下默认 marker 图标会 404,需显式设置 `L.Icon.Default` 的 `iconUrl`/`iconRetinaUrl`/`shadowUrl`;坐标一律 `[lat, lng]`,GeoJSON 是 `[lng, lat]`。
|
|
351
|
+
- **生命周期**:SPA 卸载必须 `map.remove()` 并解绑自定义事件;容器隐藏或尺寸变化后 `map.invalidateSize()`。
|
|
352
|
+
- **常见症状**:地图区域空白多为容器没设高度;`L is not defined` 是脚本顺序或 CDN 失败;漏引 `leaflet.css` 会导致控件错位。
|
|
353
|
+
- **安全与权限**:装包、起服务、改端口前先征得用户同意;天地图等瓦片服务的 `tk` 不要硬编码进提交的前端代码。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mapbox-gl-js
|
|
3
|
-
description: "Use when building
|
|
3
|
+
description: "Use when building vector web maps with mapbox-gl 3.33.0 — WebGL rendering, Style Spec layers, data-driven expressions, setTerrain raster-dem, fill-extrusion, or debugging 401 'A valid Mapbox access token is required', 'Style is not done loading', and pk./sk. token handling. Note: v2+ is proprietary under Mapbox TOS and requires a token; MapLibre GL JS is the open-source fork."
|
|
4
4
|
tags:
|
|
5
5
|
- javascript
|
|
6
6
|
- web
|
|
@@ -424,11 +424,13 @@ map.on('load', () => {
|
|
|
424
424
|
- **cesiumjs** — 三维地球与 3D Tiles 可视化:[../cesiumjs/SKILL.md](../cesiumjs/SKILL.md)
|
|
425
425
|
- **geoserver** — 发布 WMS/WFS/MVT 服务作为矢量瓦片数据源:[../geoserver/SKILL.md](../geoserver/SKILL.md)
|
|
426
426
|
|
|
427
|
-
##
|
|
427
|
+
## DeepSeek Harness 使用建议
|
|
428
428
|
|
|
429
|
-
-
|
|
430
|
-
-
|
|
431
|
-
-
|
|
432
|
-
-
|
|
433
|
-
-
|
|
434
|
-
-
|
|
429
|
+
- **加载与引用**:用 `skill("mapbox-gl-js")` 加载(用户也可输入 `/mapbox-gl-js`);本技能无 reference 子目录,示例代码写入会话工作区工程,技能目录只读。
|
|
430
|
+
- **执行环境**:`npm install`、`npm run build` 交给 `pwsh`;Windows 下用 `npm.cmd`,长构建用后台作业。
|
|
431
|
+
- **先探测版本**:`npm ls mapbox-gl`(未装则 `npm view mapbox-gl version`);本技能按 3.33.0 编写,CDN 的 JS 与 CSS 必须同为 `v3.33.0`,联网时 `curl.exe -I https://api.mapbox.com/mapbox-gl-js/v3.33.0/mapbox-gl.js` 应为 200。
|
|
432
|
+
- **验证产物**:`npm run build` 后 `npx serve dist`,`curl.exe -I http://localhost:5173/` 确认入口;地图是否真加载、有没有 401 只能看浏览器 Network(`api.mapbox.com`),DSH 不打开浏览器,请用户确认或提供截图后再 `read_image`。
|
|
433
|
+
- **token 安全**:前端只允许 `pk.` 公开 token,`sk.` 绝不能进构建产物;用 `VITE_MAPBOX_TOKEN` 等环境变量注入,提交前用 dsh 的 `grep` 搜 `sk.` 与硬编码 `pk.`,回答和日志里不要回显 token。
|
|
434
|
+
- **许可提醒**:v2+ 是 Mapbox 专有许可并受配额计费约束;用户要求开源或免 token 时改写为 MapLibre(`maplibregl` 替代 `mapboxgl`,`mapbox://` 样式换成自建瓦片)。
|
|
435
|
+
- **常见症状**:`Style is not done loading` 是 `load` 事件前调了 `addSource`/`addLayer`;空白先查容器高度和 `map.resize()`;`e.features` 只在回调内有效。
|
|
436
|
+
- **安全与权限**:装包、起 dev server、调用计费接口前先征得用户同意,并说明可能产生费用。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mapserver
|
|
3
|
-
description: "Use when publishing
|
|
3
|
+
description: "Use when publishing WMS/WFS/WCS/OGC API Features from a MapServer 8.6.6 .map mapfile — MAP/LAYER/CLASS/STYLE objects, STATUS/PROJECTION/EXTENT errors, WEB.METADATA wms_enable_request and wfs_enable_request, SLD binding, FastCGI plus MS_MAP_PATTERN hardening, and blank GetMap / \"No query information to decode\" symptoms."
|
|
4
4
|
tags:
|
|
5
5
|
- c
|
|
6
6
|
- server
|
|
@@ -285,10 +285,12 @@ ogr2ogr -f GPKG clip.gpkg countries.gpkg -clipsrc 100 20 130 50
|
|
|
285
285
|
|
|
286
286
|
---
|
|
287
287
|
|
|
288
|
-
##
|
|
288
|
+
## DeepSeek Harness 使用建议
|
|
289
289
|
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
-
|
|
293
|
-
-
|
|
294
|
-
-
|
|
290
|
+
- **加载与引用**:`skill("mapserver")` 加载;技能目录只读,mapfile、SLD 与测试数据写到会话工作区。
|
|
291
|
+
- **执行环境**:命令交给 dsh 的 `pwsh`(Windows 用 OSGeo4W 的 `mapserv.exe`);`sudo apt`、`tar -zxvf` 不跨平台,Windows 改 `Expand-Archive`,装包或改系统目录前先问用户。
|
|
292
|
+
- **先探测版本**:`mapserv -v`,确认输出含 `MapServer version 8.6.6` 且 `SUPPORTS=` 里有需要的 `WMS_SERVER`/`WFS_SERVER`;缺项说明该构建没编进对应库,改 mapfile 无用。
|
|
293
|
+
- **验证产物**:先离线 `map2img -m demo.map -o out.png -s 600 400` 看渲染,再 `mapserv -nh "QUERY_STRING=map=/abs/demo.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities"` 抓能力文档,最后才 `curl -sI "http://host/cgi-bin/mapserv?map=...&REQUEST=GetMap..."` 确认 200 与 `Content-Type: image/png`。
|
|
294
|
+
- **排障分流**:空白图查 `EXTENT`/`BBOX`/`PROJECTION`/`STATUS ON`;能力文档缺图层查 `wms_enable_request`、`wfs_enable_request` 与 `NAME` 是否字母开头;WFS 无属性字段是 8.x 默认行为,补 `gml_include_items`。
|
|
295
|
+
- **安全与权限**:`map=` 可读任意路径是 MapServer 最典型误配置,生产必须设 `MS_MAP_PATTERN`/`MS_MAP_NO_PATH`;重启 Apache/nginx 或改 CGI 权限前先向用户确认。
|
|
296
|
+
- **改一处验一处**:改 `WEB.METADATA` 后只重跑 `GetCapabilities`,改 `LAYER` 样式后只重跑 `map2img`,缩小排查范围。
|
package/assets/mapsui/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mapsui
|
|
3
|
-
description: "Use when embedding interactive 2D maps in .NET desktop (WinForms
|
|
3
|
+
description: "Use when embedding interactive 2D maps in .NET desktop (WPF/WinUI/WinForms) or mobile (MAUI/Avalonia/Blazor) apps with Mapsui 5.1.0 (net8.0/net9.0) — Mapsui.Wpf/Mapsui.Maui packages, Map and Layers, OpenStreetMap.CreateTileLayer, Shapefile/GeoJSON via Mapsui.Nts, SphericalMercator.FromLonLat, or fixing a blank MapControl."
|
|
4
4
|
tags:
|
|
5
5
|
- dotnet
|
|
6
6
|
- csharp
|
|
@@ -18,7 +18,7 @@ tags:
|
|
|
18
18
|
>
|
|
19
19
|
> **官方文档:** <https://mapsui.com/v5/documentation/index.html>
|
|
20
20
|
>
|
|
21
|
-
> **最新版本:** 5.1.0(截至2026-10,NuGet
|
|
21
|
+
> **最新版本:** 5.1.0(截至 2026-10,NuGet 稳定版;5.2.0-beta.1 为预发布)
|
|
22
22
|
>
|
|
23
23
|
> **许可证:** MIT
|
|
24
24
|
|
|
@@ -251,23 +251,15 @@ map.Layers.Add(new ImageLayer("Rivers") { DataSource = wmsProvider });
|
|
|
251
251
|
map.ZoomToExtents();
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
##
|
|
254
|
+
## DeepSeek Harness 使用建议
|
|
255
255
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
### 关键注意事项
|
|
265
|
-
|
|
266
|
-
- **NuGet 包完整**:确保安装了 `Mapsui.<UI框架>`、`Mapsui.Tiling`、`Mapsui.Nts` 三个包
|
|
267
|
-
- **投影转换**:WGS84 经纬度必须通过 `SphericalMercator.FromLonLat()` 转换后才能用于 Mapsui 定位
|
|
268
|
-
- **Shapefile 编码**:中文 Shapefile 需指定 `Encoding`(如 `Encoding.UTF8` 或 `Encoding.GetEncoding("GBK")`)
|
|
269
|
-
- **样式共享**:共享 `Brush`/`Pen`/`VectorStyle` 实例可提升性能
|
|
270
|
-
- **海量点优化**:使用 `RasterizingTileLayer` 包装海量点图层,按瓦片预渲染
|
|
256
|
+
- **加载与引用**:用 `skill("mapsui")` 加载(用户也可输入 `/mapsui`);示例写入会话工作区的 .NET 工程,技能目录只读。
|
|
257
|
+
- **执行环境**:先 `dotnet --list-sdks`;Mapsui 5.1.0 的目标框架是 net8.0/net9.0(`Mapsui.Wpf` 为 net8.0-windows/net9.0-windows),低于 .NET 8 的工程不能直接引用。命令交给 `pwsh`,例如 `dotnet add package Mapsui.Wpf --version 5.1.0`。
|
|
258
|
+
- **验证产物**:`dotnet build` 只证明编译通过;无头渲染用 `Mapsui.Rendering.Skia.MapRenderer.RenderToBitmapStream(map, ...)` 输出 PNG 的 MemoryStream(参数以 IntelliSense 为准),落盘后 `read_image` 检查;WinForms/WPF 窗口 DSH 看不到,需用户运行后提供截图。
|
|
259
|
+
- **投影**:定位坐标必须 `SphericalMercator.FromLonLat(lon, lat)` 转换,直接用经纬度会定位到南太平洋。
|
|
260
|
+
- **数据**:Shapefile 中文要指定 `Encoding`(UTF8 或 GBK);矢量要素装 `Mapsui.Nts`,瓦片装 `Mapsui.Tiling`,UI 包装 `Mapsui.Wpf`/`Mapsui.Maui`。
|
|
261
|
+
- **常见症状**:`MapControl` 空白先查是否赋值 `MapControl.Map`;MAUI 空白查 `UseSkiaSharp()` 与 `UseMapsui()` 是否注册。
|
|
262
|
+
- **安全与权限**:新建工程、装包、运行桌面程序前先征得用户同意;PostGIS/瓦片服务的密码不要写进代码或回答。
|
|
271
263
|
|
|
272
264
|
## 相关技能
|
|
273
265
|
|