@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
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,37 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.3] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Every GIS skill now ends with a `## DeepSeek Harness 使用建议` section covering skill
|
|
13
|
+
loading and reference reads, shell-tool mapping (`pwsh` and `run_code`), version
|
|
14
|
+
probes, artifact verification, and permission/secret handling. Generic "AI 使用建议"
|
|
15
|
+
sections were replaced rather than duplicated, so most skills got shorter.
|
|
16
|
+
- Descriptions rewritten for skill discovery: concrete commands, package coordinates,
|
|
17
|
+
formats, and error symptoms, still starting with "Use when" and within the upstream
|
|
18
|
+
500-character limit.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Synced the vendored GIS skills to opengis-skills commit `4b64b89`; version claims
|
|
23
|
+
re-verified against upstream releases on 2026-10-20.
|
|
24
|
+
- GeoServer (plus `geoserver-rest-api` and the `opengis-all` image tag) 3.0.1 → 3.0.2:
|
|
25
|
+
SourceForge binary URL, Docker tag, Java 17/21 prerequisite, and the 2026-10-19
|
|
26
|
+
security-release note.
|
|
27
|
+
- GeoServer Cloud 3.0.1.1 → 3.0.2 and Helm chart `geoservercloud` 3.0.1 → 3.0.2.
|
|
28
|
+
- GeoTools 35.1 → 35.2 (JDK 17); NetTopologySuite notes now pin IO.GeoJSON 4.0.0,
|
|
29
|
+
IO.Esri.Shapefile 1.2.0, and ProjNet 2.1.0.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- QGIS Server guidance probes the installed QGIS version instead of assuming a
|
|
34
|
+
`qgis_mapserver --version` binary; Cesium no longer asserts a 1.150 removal date;
|
|
35
|
+
Mapsui notes that 5.2.0-beta.1 is a prerelease.
|
|
36
|
+
- Escaped inner quotes in rewritten frontmatter descriptions so the strict DSH
|
|
37
|
+
frontmatter parser accepts every skill.
|
|
38
|
+
|
|
8
39
|
## [0.1.2] - 2026-10-19
|
|
9
40
|
|
|
10
41
|
### Added
|
package/README.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
> **English summary** — A DeepSeek Harness bundle that packages the `gis/` skills of
|
|
4
4
|
> [opengis-skills](https://github.com/znlgis/opengis-skills) as installable, toggleable skills.
|
|
5
5
|
> The session catalog lists names and descriptions only; skill bodies and their
|
|
6
|
-
> `reference/*.md` files are loaded on demand
|
|
7
|
-
>
|
|
6
|
+
> `reference/*.md` files are loaded on demand, and every body carries DeepSeek Harness
|
|
7
|
+
> execution guidance (tool mapping, version probes, verification, permissions). Zero
|
|
8
|
+
> runtime dependencies: every asset ships inside the npm package.
|
|
8
9
|
>
|
|
9
10
|
> Compatibility: DeepSeek Harness `>=0.2.0-rc.2 <0.3.0-0`; Node.js `>=22` for development
|
|
10
11
|
> only. MIT licensed.
|
|
@@ -15,9 +16,10 @@ DeepSeek Harness 的 **OpenGIS 技能包插件**:把 [opengis-skills](https://
|
|
|
15
16
|
|
|
16
17
|
- **覆盖 GIS 全链路**:GDAL、GDAL API、QGIS(qgis_process / PyQGIS / QGIS Server)、GeoServer(含 REST API 与 Cloud)、MapServer、PostGIS、PROJ、PDAL、GRASS GIS、JTS、NetTopologySuite、Esri Geometry API(Java/.NET)、Shapely、GeoPandas、GeoPipeAgent、OpenGisDAF、CesiumJS、OpenLayers、Leaflet、Mapbox GL JS、deck.gl、SharpMap、Mapsui、GeoTools、OpenGIS Utils(Java/.NET),以及 `opengis-all` 全流程索引。
|
|
17
18
|
- **按需加载**:注册的是 skill provider(`ctx.skills.registerProvider`),发现阶段只读 frontmatter;正文每次加载时读取,参考资料(`reference/*.md`)通过技能目录(resource base)相对解析。
|
|
18
|
-
- **零运行时依赖**:只用 Node 内置模块,不 import DSH 内部包;全部资产随 npm 包分发,整个包解包后约
|
|
19
|
+
- **零运行时依赖**:只用 Node 内置模块,不 import DSH 内部包;全部资产随 npm 包分发,整个包解包后约 720 kB。
|
|
19
20
|
- **可同步上游**:`npm run sync` 从 opengis-skills 检出复制资产,记录上游 commit 与每个文件的 SHA-256 到 `upstream.json`,并重新生成本文下方技能清单。
|
|
20
21
|
- **可启停**:单包同时是 bundle 与插件(`dsh.bundle.patch` 插入自身行),在 Plugins 里启用/停用即可。
|
|
22
|
+
- **面向 DSH 的执行建议**:每个技能末尾都有 `## DeepSeek Harness 使用建议`,写明如何按需读 reference、Windows 下如何映射 shell 命令、先跑哪个版本探测命令、如何重新打开产物验证,以及哪些安装/覆盖/凭据操作要先确认。
|
|
21
23
|
|
|
22
24
|
## 兼容性
|
|
23
25
|
|
|
@@ -34,38 +36,38 @@ DeepSeek Harness 的 **OpenGIS 技能包插件**:把 [opengis-skills](https://
|
|
|
34
36
|
<!-- skills:start -->
|
|
35
37
|
| Skill | Description (upstream frontmatter) |
|
|
36
38
|
| --- | --- |
|
|
37
|
-
| `cesiumjs` | Use when building browser-based 3D globes, 3D Tiles
|
|
38
|
-
| `deck-gl` | Use when visualizing large geospatial
|
|
39
|
-
| `gdal` | Use when processing geospatial raster/vector data via
|
|
40
|
-
| `gdal-api` | Use when programming against GDAL/OGR in C, C++, Python, Java, or .NET
|
|
41
|
-
| `geometry-api-java` | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in Java —
|
|
42
|
-
| `geometry-api-net` | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in .NET/C# —
|
|
43
|
-
| `geopandas` | Use when
|
|
44
|
-
| `geopipe-agent` | Use when building
|
|
45
|
-
| `geoserver` | Use when deploying
|
|
46
|
-
| `geoserver-cloud` | Use when deploying GeoServer on Kubernetes
|
|
47
|
-
| `geoserver-rest-api` | Use when automating GeoServer
|
|
48
|
-
| `geotools` | Use when building Java GIS
|
|
39
|
+
| `cesiumjs` | Use when building browser-based 3D globes, 3D Tiles, CZML/time-dynamic data, or glTF models with npm cesium 1.146.0 — Viewer, Cesium3DTileset, Ion token (Cesium.Ion.defaultAccessToken), CESIUM_BASE_URL for Workers/Assets/Widgets, GCJ-02 tile offset, or debugging a black screen after a Vite/Webpack build. |
|
|
40
|
+
| `deck-gl` | Use when visualizing large geospatial datasets in the browser with deck.gl 9.4.0 — ScatterplotLayer/GeoJsonLayer, HexagonLayer/ScreenGridLayer aggregation, MVTLayer/TileLayer, @deck.gl/mapbox MapboxOverlay over MapLibre, or debugging blank canvases, stale data props and mismatched @deck.gl/* subpackage versions. |
|
|
41
|
+
| `gdal` | Use when processing geospatial raster/vector data via GDAL/OGR CLI — ogr2ogr format conversion (Shapefile/GeoPackage/GeoJSON), gdalwarp reprojection, gdal_translate, gdal_calc.py NDVI, COG, mosaicking, DEM contours, gdalinfo -json checks — or diagnosing "not recognized as a supported file format"; also covers the 3.9+ unified gdal raster / gdal vector CLI. |
|
|
42
|
+
| `gdal-api` | Use when programming against GDAL/OGR in C, C++, Python, Java, or .NET — raster/vector I/O, gdal.UseExceptions, OGRSpatialReference transforms, gdal.Translate / gdal.Warp, VRT/COG, or fixing "no driver registered" and UnsatisfiedLinkError; C++ gdal-config, Maven org.gdal:gdal 3.13.0, NuGet MaxRev.Gdal.Core. |
|
|
43
|
+
| `geometry-api-java` | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in Java — GeometryEngine, com.esri.geometry:esri-geometry-api:2.2.4, WKT/WKB/GeoJSON/Esri JSON I/O, geodesic distance; also when GeometryEngine has no intersects or WKB method and you need OperatorFactoryLocal, or when 2.3.1 coordinates fail to resolve on Maven Central. Esri Geometry API for Java. |
|
|
44
|
+
| `geometry-api-net` | Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in .NET/C# — GeometryEngine, NuGet OpenGIS.Esri.Geometry.Core 1.0.9, WKT/EWKT, WKB, GeoJSON and Esri JSON I/O, System.Text.Json converters, geodesic distance; also for unclosed polygon rings, Geometry base-class casts after overlay, or the retired Esri/geometry-api-net repo. Esri Geometry API for .NET. |
|
|
45
|
+
| `geopandas` | Use when doing vector spatial analysis in Python — gpd.read_file/to_file via pyogrio (GPKG, Shapefile, GeoParquet), sjoin/sjoin_nearest, overlay, clip, dissolve, to_crs vs set_crs, gdf.plot choropleth; also for CRSError from a missing PROJ data dir, area/distance computed in degrees, or GeoDataFrame geometry-column conflicts. GeoPandas 1.2.0 extends pandas DataFrames with geometry columns. |
|
|
46
|
+
| `geopipe-agent` | 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). |
|
|
47
|
+
| `geoserver` | 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. |
|
|
48
|
+
| `geoserver-cloud` | 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. |
|
|
49
|
+
| `geoserver-rest-api` | 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. |
|
|
50
|
+
| `geotools` | 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. |
|
|
49
51
|
| `grass-gis` | Use when doing GIS geoprocessing with GRASS GIS headlessly — grass --exec and --tmp-project for servers and CI, g.region computational region management, r.* raster, v.* vector, r3.* 3D raster and t.* temporal modules, r.import/v.import data import, or Python scripting with grass.script, grass.script.array and grass.tools. |
|
|
50
|
-
| `jts` | Use when
|
|
51
|
-
| `leaflet` | Use when adding lightweight
|
|
52
|
-
| `mapbox-gl-js` | Use when building
|
|
53
|
-
| `mapserver` | Use when publishing
|
|
54
|
-
| `mapsui` | Use when embedding interactive 2D maps in .NET desktop (WinForms
|
|
55
|
-
| `nettopologysuite` | Use when
|
|
56
|
-
| `opengis-all` | Use when navigating end-to-end GIS workflows —
|
|
57
|
-
| `opengis-daf` | Use when building plan
|
|
58
|
-
| `opengis-utils-for-java` | Use when needing common GIS
|
|
59
|
-
| `opengis-utils-for-net` | Use when needing common GIS
|
|
60
|
-
| `openlayers` | Use when adding interactive 2D maps to web
|
|
52
|
+
| `jts` | 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. |
|
|
53
|
+
| `leaflet` | 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(). |
|
|
54
|
+
| `mapbox-gl-js` | 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. |
|
|
55
|
+
| `mapserver` | 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. |
|
|
56
|
+
| `mapsui` | 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. |
|
|
57
|
+
| `nettopologysuite` | Use when doing 2D computational geometry in .NET with NuGet NetTopologySuite 2.6.0 — GeometryFactory with SRID, Contains/Intersects predicates, Intersection/Union/Buffer overlays, STRtree, GeometryFixer, WKT/WKB/GeoJSON I/O, Shapefile via IO.Esri, and EF Core spatial queries on SQL Server/Npgsql. |
|
|
58
|
+
| `opengis-all` | Use when navigating end-to-end GIS workflows — GDAL CLI/API (ogr2ogr, gdalwarp, gdal_calc.py), qgis_process and PyQGIS analysis, GeoServer REST publishing, and OpenLayers/CesiumJS visualization. One-stop index covering the complete open-source GIS data pipeline. |
|
|
59
|
+
| `opengis-daf` | Use when building JSON-plan GIS analysis or QC pipelines with OpenGisDAF (.NET 10 / C# 14) — daf validate/run, operators buffer/clip/intersect_check/containment_check/coordinate_transform, DAG upstream bindings, GeoJSON/Shapefile/PostGIS sinks, qcMode QC reports, AssemblyLoadContext plugins; also for "zero tests ran" exit code 5, missing --recurse-submodules GDAL build errors, or PostGIS Layer already exists. Plan-driven ETL. |
|
|
60
|
+
| `opengis-utils-for-java` | Use when needing common GIS utilities in Java — OguLayerUtil layer read/write, GeometryUtil 60+ ops, CrsUtil CGCS2000 (EPSG:4490, 4502-4554), Shapefile/GeoJSON/FileGDB/PostGIS/land TXT I/O, topology validation; also for GDAL UnsatisfiedLinkError on gdal_jni, missing osgeo repo on GeoTools, or resolving com.znlgis.ogu4j:ogu4j:1.0.0 that is not on Maven Central. OGU4J. |
|
|
61
|
+
| `opengis-utils-for-net` | Use when needing common GIS utilities in .NET/C# — OguLayerUtil ReadLayer/WriteLayer/ConvertFormat, GeometryUtil 50+ ops, CrsUtil CGCS2000 transforms, Shapefile/GeoJSON/FileGDB/GeoPackage/KML/PostGIS I/O; also for Unable to load DLL gdal / DllNotFoundException, GBK shapefile mojibake, or ArgumentException from Geojson2Wkt on a whole FeatureCollection. OpenGIS.Utils 1.1.2. |
|
|
62
|
+
| `openlayers` | Use when adding interactive 2D maps to web apps with npm ol 10.11.0 — Map/View, fromLonLat to EPSG:3857, WMS/WMTS/XYZ sources, MVT with featureClass, Draw/Modify/Snap interactions, or debugging blank layers (missing setStyle), offset centers and ol/... module-not-found errors. |
|
|
61
63
|
| `pdal` | Use when processing point cloud data (LAS/LAZ/BPF/EPT/COPC) via CLI or Python — pipeline JSON workflows, format conversion, reprojection, cropping, outlier removal, ground classification (SMRF), and DEM generation from LiDAR. PDAL (Point Data Abstraction Library) is the point cloud equivalent of GDAL: pdal info/translate/pipeline commands plus pdal.Pipeline Python bindings. |
|
|
62
|
-
| `postgis` | Use when extending PostgreSQL with
|
|
63
|
-
| `proj` | Use when
|
|
64
|
-
| `pyqgis` | Use when
|
|
65
|
-
| `qgis-process` | Use when running QGIS geoprocessing
|
|
66
|
-
| `qgis-server` | Use when publishing QGIS projects (.qgs/.qgz) as OGC web services
|
|
67
|
-
| `shapely` | Use when
|
|
68
|
-
| `sharpmap` | Use when rendering 2D maps in legacy .NET WinForms or ASP.NET WebForms
|
|
64
|
+
| `postgis` | Use when extending PostgreSQL with PostGIS 3.6.4 — geometry/geography/raster types, GiST and KNN <-> indexes, ST_Intersects/ST_Buffer/ST_Transform/ST_AsMVT, shp2pgsql -I and raster2pgsql import, and fixing "Operation on mixed SRID", slow spatial joins, and invalid polygons with ST_MakeValid. |
|
|
65
|
+
| `proj` | Use when transforming coordinates or inspecting CRS definitions from the command line — cs2cs, projinfo -s/-t, proj projection math, cct, EPSG lookup, datum shift with grid files, WKT/PROJJSON export, or debugging "Cannot find proj.db" and latitude-first axis order. PROJ 9.9.0: the OSGeo engine behind GDAL/QGIS, with the proj.db SQLite database. |
|
|
66
|
+
| `pyqgis` | Use when scripting QGIS with Python — QgsApplication standalone init, QgsVectorLayer / QgsRasterLayer loading, processing.run after Processing.initialize(), QgsGeometry / QgsExpression, QgsMapSettings rendering and QgsLayoutExporter PDF/PNG export, qgis._3d, or debugging "import qgis.core" failures. PyQGIS for QGIS 4.2.3 and LTR 3.44.15, Python 3.12. |
|
|
67
|
+
| `qgis-process` | Use when running QGIS geoprocessing headless via qgis_process — native:buffer / native:reprojectlayer / native:clip, qgis_process list / help --json / run --json, .model3 models and .py scripts, batch CI pipelines, or debugging "Algorithm ... not found!"; includes QT_QPA_PLATFORM=offscreen and the qgis/qgis images (stable 4.2, ltr 3.44). |
|
|
68
|
+
| `qgis-server` | Use when publishing QGIS projects (.qgs/.qgz) as OGC web services — WMS GetMap/GetPrint, WFS and WFS-T, WMTS, OGC API Features via qgis_mapserv.fcgi with Apache mod_fcgid, Nginx, or Docker, plus QGIS_SERVER_* tuning (MAX_THREADS, PARALLEL_RENDERING, LOG_STDERR); covers "Service unknown or unsupported" and MAP/GetCapabilities checks. QGIS 4.2.3 and LTR 3.44.15. |
|
|
69
|
+
| `shapely` | Use when doing computational geometry in Python — shapely.intersection/union/buffer/convex_hull/simplify, STRtree queries, from_wkt/to_wkt/to_geojson, make_valid, GEOS-gated ops (coverage_clean, split); also for TopologyException on self-intersecting polygons or OOP vs function buffer quad_segs mismatch. Shapely 2.2.0 binds GEOS. |
|
|
70
|
+
| `sharpmap` | Use when rendering 2D maps in legacy .NET Framework 4.7.2 WinForms or ASP.NET WebForms apps with SharpMap 1.2.0 — Map.GetMap() to PNG, ShapeFile/PostGIS providers, VectorLayer with CustomTheme, TileAsyncLayer via BruTile, ProjNet4GeoAPI transforms, or debugging blank output and GDI+ handle leaks. New projects should use Mapsui. |
|
|
69
71
|
<!-- skills:end -->
|
|
70
72
|
|
|
71
73
|
## 安装
|
|
@@ -105,6 +107,14 @@ dsh plugin --profile <profile> remove @dsh-gis/dsh-opengis-skill
|
|
|
105
107
|
- `openlayers` / `cesiumjs` / `deck-gl` — Web 2D/3D 可视化。
|
|
106
108
|
- 加载结果会给出该技能的 **Base directory**;正文中的 `reference/*.md` 与 `../<其他技能>/SKILL.md` 相对链接都据此解析。因为全部技能资产随同一个包一起分发,跨技能链接不需要额外安装或配置。
|
|
107
109
|
|
|
110
|
+
## DeepSeek Harness 适配
|
|
111
|
+
|
|
112
|
+
- 每个技能正文末尾都有 `## DeepSeek Harness 使用建议`:先加载哪个技能、哪些 `reference/*.md` 值得按需读取、先跑什么版本探测命令、产物怎样重新打开验证、哪些操作要先征得用户同意。
|
|
113
|
+
- 命令统一走 DSH 的 shell 工具:Windows 用 `pwsh`;若当前会话只暴露 `run_code`,则在其中调用 `tools.pwsh`。正文里的 Bash 示例(`sudo`、`/tmp`、heredoc、反引号)按平台改写。
|
|
114
|
+
- 文件与日志优先用 `read` / `grep` / `glob` 分段读取;大输出先落盘,长任务放后台作业。技能目录和运行时是只读资源,脚本与产物写到会话工作区。
|
|
115
|
+
- 技能正文标注的是 2026-10-20 核验的上游版本(例如 GeoServer 3.0.2、GeoTools 35.2、QGIS 4.2.3 / LTR 3.44.15、GDAL 3.13.3)。实际环境版本不同时,先探测版本,再按“低版本降级”或“高版本新增 API”说明差异,不要照搬不存在的命令。
|
|
116
|
+
- 技能只是领域知识与执行约定,不会替你安装工具、绕过沙箱或读取凭据;安装依赖、启动服务、覆盖数据、执行破坏性 SQL 前先向用户确认,命令输出中不要回显密码与 token。
|
|
117
|
+
|
|
108
118
|
## 上游同步
|
|
109
119
|
|
|
110
120
|
> 本节只适用于**本仓库的源码开发**。`scripts/` 与 `test/` 不在 npm 发布包内(`package.json` 的 `files` 未包含它们),安装用户无需执行这些命令。
|
package/assets/cesiumjs/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: cesiumjs
|
|
3
|
-
description: "Use when building browser-based 3D globes, 3D Tiles
|
|
3
|
+
description: "Use when building browser-based 3D globes, 3D Tiles, CZML/time-dynamic data, or glTF models with npm cesium 1.146.0 — Viewer, Cesium3DTileset, Ion token (Cesium.Ion.defaultAccessToken), CESIUM_BASE_URL for Workers/Assets/Widgets, GCJ-02 tile offset, or debugging a black screen after a Vite/Webpack build."
|
|
4
4
|
tags:
|
|
5
5
|
- javascript
|
|
6
6
|
- webgl
|
|
@@ -49,7 +49,7 @@ npm install cesium
|
|
|
49
49
|
<script src="https://cdn.jsdelivr.net/npm/cesium/Build/Cesium/Cesium.js"></script>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
> **1.146 变更:** 数学/几何/时间/工具类被拆分为新包 `@cesium/core
|
|
52
|
+
> **1.146 变更:** 数学/几何/时间/工具类被拆分为新包 `@cesium/core`(`cesium@1.146.0` 依赖 `@cesium/core@^0.1.0`)。从 `cesium` 主包导入的代码不受影响;直接按子路径引用 `@cesium/engine` 的代码需改从 `@cesium/core` 导入(旧导出计划在后续版本移除,1.146 仍可用)。
|
|
53
53
|
|
|
54
54
|
### Vite 集成
|
|
55
55
|
|
|
@@ -263,17 +263,16 @@ viewer.trackedEntity = entity;
|
|
|
263
263
|
|
|
264
264
|
---
|
|
265
265
|
|
|
266
|
-
##
|
|
266
|
+
## DeepSeek Harness 使用建议
|
|
267
267
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
276
|
-
- **静态资源部署**:使用 Webpack/Vite 时,确保 `Assets`、`Workers`、`Widgets` 目录正确复制到输出目录
|
|
268
|
+
- **加载与引用**:用 `skill("cesiumjs")` 加载(用户也可输入 `/cesiumjs`);本技能无 reference 子目录,示例代码直接落到会话工作区的工程里,技能目录只读。
|
|
269
|
+
- **执行环境**:`npm install`、`npm run build` 交给 `pwsh`;Windows 下 `npm` 实为 `npm.cmd`,脚本里写 `cmd /c npm run build` 更稳;装包和大构建用后台作业,输出重定向到文件再分段读。
|
|
270
|
+
- **先探测版本**:`npm ls cesium`(未安装时 `npm view cesium version`)。本技能按 1.146.0 编写:该版本依赖 `@cesium/core@^0.1.0`,数学/几何/时间/工具类已拆到 `@cesium/core`,低于 1.146 的工程不要照搬这条迁移建议。
|
|
271
|
+
- **验证产物**:`npm run build` 通过后用 `npx serve dist` 或 `python -m http.server 5173 -d dist` 起静态服务,用 `curl.exe -I` 检查 `http://localhost:5173/Cesium.js` 与 `.../Cesium/Widgets/widgets.css` 返回 200(404 或 text/html 说明资源没拷贝);DSH 不打开浏览器,把 URL 和预期画面交给用户,有截图再用 `read_image` 核对。
|
|
272
|
+
- **Ion 与部署**:`Cesium.Ion.defaultAccessToken` 从环境变量注入(Vite 用 `import.meta.env.VITE_CESIUM_ION_TOKEN`),不要写进源码或提交;黑屏先查 `window.CESIUM_BASE_URL` 与 `Workers/Assets/Widgets` 是否随构建产物发布。
|
|
273
|
+
- **坐标与性能**:定位一律 `Cesium.Cartesian3.fromDegrees(lon, lat, height)`;大量静态要素用 Primitive,少量动态要素才用 Entity;`clampToGround` 只在需要贴地时开启。
|
|
274
|
+
- **常见症状**:瓦片整体错位是国内底图的 GCJ-02 偏移,需先纠偏;ion 服务 401/403 多为 token 未设置或失效;`tileset.destroy()`、`viewer.dataSources.remove()` 不调用会持续占用显存。
|
|
275
|
+
- **安全与权限**:安装依赖、启动 dev server、改端口前先征得用户同意;日志和回答中不要回显 Ion token。
|
|
277
276
|
|
|
278
277
|
## 相关技能
|
|
279
278
|
|
package/assets/deck-gl/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deck-gl
|
|
3
|
-
description: "Use when visualizing large geospatial
|
|
3
|
+
description: "Use when visualizing large geospatial datasets in the browser with deck.gl 9.4.0 — ScatterplotLayer/GeoJsonLayer, HexagonLayer/ScreenGridLayer aggregation, MVTLayer/TileLayer, @deck.gl/mapbox MapboxOverlay over MapLibre, or debugging blank canvases, stale data props and mismatched @deck.gl/* subpackage versions."
|
|
4
4
|
tags:
|
|
5
5
|
- javascript
|
|
6
6
|
- web
|
|
@@ -439,12 +439,13 @@ map.addControl(overlay);
|
|
|
439
439
|
- **leaflet** — 轻量 2D 瓦片地图,适合中小数据量与简单场景:[../leaflet/SKILL.md](../leaflet/SKILL.md)
|
|
440
440
|
- **cesiumjs** — 三维地球与 3D Tiles 可视化:[../cesiumjs/SKILL.md](../cesiumjs/SKILL.md)
|
|
441
441
|
|
|
442
|
-
##
|
|
442
|
+
## DeepSeek Harness 使用建议
|
|
443
443
|
|
|
444
|
-
-
|
|
445
|
-
-
|
|
446
|
-
-
|
|
447
|
-
-
|
|
448
|
-
-
|
|
449
|
-
-
|
|
450
|
-
-
|
|
444
|
+
- **加载与引用**:用 `skill("deck-gl")` 加载(用户也可输入 `/deck-gl`);本技能无 reference 子目录,示例代码写入会话工作区工程,技能目录只读。
|
|
445
|
+
- **执行环境**:`npm install`、`npm run build` 交给 `pwsh`;子包多、安装输出长,重定向到文件再分段读。
|
|
446
|
+
- **先探测版本**:`npm ls deck.gl @deck.gl/core @deck.gl/layers @deck.gl/geo-layers`;所有 `@deck.gl/*` 必须是同一版本 9.4.0,混版会报 `Cannot read properties of undefined`。本技能按 9.4.0 编写。
|
|
447
|
+
- **验证产物**:`npm run build` 后 `npx serve dist`,`curl.exe -I http://localhost:5173/` 确认入口;WebGL 是否真出图只能由浏览器确认,DSH 不打开浏览器,请用户看画面和控制台,有截图再用 `read_image`。
|
|
448
|
+
- **无 GPU 环境**:无头/CI 环境无法验证 WebGL,构建通过不等于渲染正确,不要据此报告“已渲染”。
|
|
449
|
+
- **数据与坐标**:位置一律 `[经度, 纬度]`;保持 `data` 引用稳定,不要在渲染路径里 `filter`/`map` 生成新数组,否则 GPU 缓冲反复重建。
|
|
450
|
+
- **常见症状**:空白画布先查容器高度与底图;数据变了画面不变用 `updateTriggers`;tooltip 无反应是 `pickable` 默认 false。
|
|
451
|
+
- **安全与权限**:装包、起 dev server 前先征得用户同意;用 Mapbox 底图时提醒 token 与计费。
|
package/assets/gdal/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gdal
|
|
3
|
-
description: "Use when processing geospatial raster/vector data via
|
|
3
|
+
description: "Use when processing geospatial raster/vector data via GDAL/OGR CLI — ogr2ogr format conversion (Shapefile/GeoPackage/GeoJSON), gdalwarp reprojection, gdal_translate, gdal_calc.py NDVI, COG, mosaicking, DEM contours, gdalinfo -json checks — or diagnosing \"not recognized as a supported file format\"; also covers the 3.9+ unified gdal raster / gdal vector CLI."
|
|
4
4
|
|
|
5
5
|
tags:
|
|
6
6
|
- gdal
|
|
@@ -415,49 +415,15 @@ gdaltindex -recursive -of GPKG \
|
|
|
415
415
|
|
|
416
416
|
---
|
|
417
417
|
|
|
418
|
-
##
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
2. **检查支持的格式和驱动**:
|
|
429
|
-
```bash
|
|
430
|
-
gdalinfo --formats
|
|
431
|
-
ogrinfo --formats
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
3. **分步处理**(避免大内存操作):
|
|
435
|
-
```bash
|
|
436
|
-
# 不要直接镶嵌所有文件
|
|
437
|
-
# 改为逐个处理和合并
|
|
438
|
-
```
|
|
439
|
-
|
|
440
|
-
4. **使用 JSON 输出**(便于解析):
|
|
441
|
-
```bash
|
|
442
|
-
gdalinfo -json input.tif | jq '.coordinateSystem'
|
|
443
|
-
ogrinfo -json input.shp | jq '.layers[0].featureCount'
|
|
444
|
-
```
|
|
445
|
-
|
|
446
|
-
5. **优化性能**:
|
|
447
|
-
```bash
|
|
448
|
-
# 启用多线程、内存缓存、COG 格式
|
|
449
|
-
export GDAL_NUM_THREADS=ALL_CPUS
|
|
450
|
-
export GDAL_CACHEMAX=2048
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
### 关键注意事项
|
|
454
|
-
|
|
455
|
-
- **始终备份**:GDAL 可以就地修改文件(如 `gdal_edit.py`)
|
|
456
|
-
- **使用绝对路径**:避免工作目录问题
|
|
457
|
-
- **验证坐标系**:重投影前确认源和目标坐标系
|
|
458
|
-
- **测试小数据**:在大数据集上运行前,用小样本测试
|
|
459
|
-
- **使用 VRT(虚拟数据集)**:避免创建多个副本
|
|
460
|
-
- **环境变量**:设置适当的 `GDAL_CACHEMAX` 和 `GDAL_NUM_THREADS`
|
|
418
|
+
## DeepSeek Harness 使用建议
|
|
419
|
+
|
|
420
|
+
- **加载与引用**:用 `skill("gdal")` 加载(用户也可输入 `/gdal`);`reference/raster-tools.md`、`reference/vector-tools.md`、`reference/data-formats.md` 按需 `read`,路径相对加载结果中的 Base directory;技能目录只读,产物写到会话工作区。
|
|
421
|
+
- **执行环境**:命令交给 dsh 的 shell 工具(Windows 用 `pwsh`;仅暴露 `run_code` 的会话在 `tools.pwsh` 中执行)。正文的 `apt-get`、`sudo`、`export VAR=` 是 Bash 写法:Windows 改为 `$env:GDAL_NUM_THREADS = "ALL_CPUS"`,无 `sudo`/`apt` 时改用 conda-forge 或 `docker run --rm -v "${PWD}:/data" -w /data osgeo/gdal:latest ...`。
|
|
422
|
+
- **先探测版本**:`gdalinfo --version`、`ogrinfo --version`;本技能按 GDAL 3.13.3 编写,低于 3.9 没有 `gdal <command>` 新式 CLI(`gdal vector`/`gdal raster`),须退回 `ogr2ogr`/`gdalwarp`,且 `gdal_calc.py` 等脚本工具还需要 Python 绑定。
|
|
423
|
+
- **验证产物**:栅格用 `gdalinfo -json out.tif` 核对 `driverShortName`、`size`、`coordinateSystem.wkt`、`bands[].noDataValue`;矢量用 `ogrinfo -so out.shp layer`(或 `ogrinfo -json out.gpkg`)核对 `Feature Count`、`Geometry`、字段列表;不要只凭退出码报告成功。
|
|
424
|
+
- **先看错误再改参数**:`ERROR 4: ... not recognized as a supported file format` 先查路径与 `gdalinfo --formats`;`--debug on` 或 `CPL_DEBUG=ON` 看驱动细节;输出很长时重定向到文件再分段 `read`,不要一次打印全文。
|
|
425
|
+
- **批处理与中间产物**:批量循环建议用 Python 生成命令,中间结果用 `gdalbuildvrt` 写 `.vrt` 而不是反复 `gdalwarp`;耗时命令放后台作业,避免一次重投影全部数据。
|
|
426
|
+
- **安全与权限**:`gdal_edit.py`、`ogr2ogr` 写已有目标、`-overwrite`/`-append` 会就地改写或覆盖数据,先备份或换输出名;安装 GDAL、改 `GDAL_DATA`/`PROJ_LIB`、访问 `/vsis3/`(需 `AWS_SECRET_ACCESS_KEY`)前先征得用户同意,回答里不要回显密钥。
|
|
461
427
|
|
|
462
428
|
---
|
|
463
429
|
|
package/assets/gdal-api/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gdal-api
|
|
3
|
-
description: "Use when programming against GDAL/OGR in C, C++, Python, Java, or .NET
|
|
3
|
+
description: "Use when programming against GDAL/OGR in C, C++, Python, Java, or .NET — raster/vector I/O, gdal.UseExceptions, OGRSpatialReference transforms, gdal.Translate / gdal.Warp, VRT/COG, or fixing \"no driver registered\" and UnsatisfiedLinkError; C++ gdal-config, Maven org.gdal:gdal 3.13.0, NuGet MaxRev.Gdal.Core."
|
|
4
4
|
|
|
5
5
|
tags:
|
|
6
6
|
- gdal
|
|
@@ -102,7 +102,7 @@ dotnet add package MaxRev.Gdal.LinuxRuntime.Minimal # Linux
|
|
|
102
102
|
dotnet add package MaxRev.Gdal.WindowsRuntime.Minimal # Windows
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
**注意:** 官方 SWIG 绑定命名空间为 `OSGeo.GDAL`、`OSGeo.OGR`、`OSGeo.OSR`。NuGet 包 `MaxRev.Gdal.Core`
|
|
105
|
+
**注意:** 官方 SWIG 绑定命名空间为 `OSGeo.GDAL`、`OSGeo.OGR`、`OSGeo.OSR`。NuGet 包 `MaxRev.Gdal.Core` 是社区维护的跨平台封装,2026-10 的最新版为 `3.13.3.583`(对应 GDAL 3.13.3),运行时包需与 `MaxRev.Gdal.Core` 主版本一致。
|
|
106
106
|
|
|
107
107
|
---
|
|
108
108
|
|
|
@@ -315,34 +315,15 @@ src_ds = None # 释放数据源
|
|
|
315
315
|
|
|
316
316
|
---
|
|
317
317
|
|
|
318
|
-
##
|
|
318
|
+
## DeepSeek Harness 使用建议
|
|
319
319
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
### 关键注意事项
|
|
329
|
-
|
|
330
|
-
- **资源释放**:C++ 用 `GDALClose()`,Python 赋值 `None`,Java 用 `.delete()`,C# 用 `.Dispose()`
|
|
331
|
-
- **坐标轴顺序**:GDAL 3.0+ 默认纬度在前,可用 `SetAxisMappingStrategy` 切换
|
|
332
|
-
- **Python NumPy 集成**:`ReadAsArray()` 直接返回 NumPy 数组,是 Python 最大优势
|
|
333
|
-
- **CS 平台依赖**:C# 需安装对应平台运行时包(Linux/Windows)
|
|
334
|
-
- **JA 本地库**:Java 需确保 `gdalalljni` 在 `java.library.path` 中
|
|
335
|
-
|
|
336
|
-
### 各语言适用场景
|
|
337
|
-
|
|
338
|
-
| 场景 | Python | C++ | Java | C# |
|
|
339
|
-
|------|--------|-----|------|-----|
|
|
340
|
-
| 数据处理脚本 | (推荐)首选 | | | |
|
|
341
|
-
| 生产级服务 | | (推荐)首选 | (推荐) | (推荐) |
|
|
342
|
-
| GIS 桌面插件 | (推荐) | | | |
|
|
343
|
-
| .NET 企业应用 | | | | (推荐) |
|
|
344
|
-
| Android GIS | | | (推荐) | |
|
|
345
|
-
| 嵌入式系统 | | (推荐) | | |
|
|
320
|
+
- **加载与引用**:用 `skill("gdal-api")` 加载(用户也可输入 `/gdal-api`);`reference/raster-api.md`(栅格读写的完整 API)、`reference/vector-api.md`(OGR 图层与 GeoPackage)按需 `read`,路径相对 Base directory;技能目录只读,示例代码与产物写到会话工作区。
|
|
321
|
+
- **执行环境**:编译与运行交给 dsh 的 shell 工具(Windows 用 `pwsh`;仅暴露 `run_code` 的会话在 `tools.pwsh` 中执行)。C++ 用 `gdal-config --cflags --libs` 或 CMake `find_package(GDAL REQUIRED)`;Python 用装好绑定的解释器;Java 的 `gdalalljni`、.NET 的 MaxRev 运行时包必须与平台、架构匹配。
|
|
322
|
+
- **先探测版本**:`ogrinfo --version`、`python -c "from osgeo import gdal; print(gdal.VersionInfo())"`(返回 `3130300` 这类数字)、`mvn -v`、`dotnet --version`;本技能按 GDAL 3.13.3、Java 绑定 3.13.0 编写,低版本缺少新驱动与部分 SWIG 方法,回答里要说明差异。
|
|
323
|
+
- **验证产物**:写完后重新打开核对——`python -c "from osgeo import gdal; ds=gdal.Open('out.tif'); print(ds.GetDriver().ShortName, ds.RasterCount, ds.GetSpatialRef().GetAuthorityCode(None))"`;矢量用 `ogrinfo -al -so out.gpkg` 看要素数与字段;Python 一律先 `gdal.UseExceptions()`,否则错误被静默吞掉。
|
|
324
|
+
- **语言选择**:数据处理脚本优先 Python(`ReadAsArray()` 直通 NumPy);生产服务与嵌入式优先 C++;Java 注意用 `java.util.Vector<String>` 传选项;.NET 用 `OSGeo.GDAL`/`OSGeo.OGR` 命名空间,或 MaxRev 封装 + 对应平台运行时包。
|
|
325
|
+
- **资源与轴序**:Python 置 `ds = None`、C++ `GDALClose()`、Java `.delete()`、C# `.Dispose()` 之后才算落盘;GDAL 3+ 默认纬度在前,需要经度在前时用 `SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER)`,轴序改错是坐标错位最常见的原因。
|
|
326
|
+
- **安全与权限**:以更新模式(`gdal.GA_Update`、`GDALOpen(..., GA_Update)`)打开会直接改原文件;覆盖已有输出前先确认;安装 `libgdal-dev`、`dotnet add package`、写系统目录前先征得用户同意。
|
|
346
327
|
|
|
347
328
|
## 相关技能
|
|
348
329
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geometry-api-java
|
|
3
|
-
description: "Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in Java —
|
|
3
|
+
description: "Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in Java — GeometryEngine, com.esri.geometry:esri-geometry-api:2.2.4, WKT/WKB/GeoJSON/Esri JSON I/O, geodesic distance; also when GeometryEngine has no intersects or WKB method and you need OperatorFactoryLocal, or when 2.3.1 coordinates fail to resolve on Maven Central. Esri Geometry API for Java."
|
|
4
4
|
tags:
|
|
5
5
|
- java
|
|
6
6
|
- geometry
|
|
@@ -376,23 +376,16 @@ if (hit) {
|
|
|
376
376
|
|
|
377
377
|
---
|
|
378
378
|
|
|
379
|
-
##
|
|
379
|
+
## DeepSeek Harness 使用建议
|
|
380
380
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
### 关键注意事项
|
|
390
|
-
|
|
391
|
-
- **坐标系一致**:进行空间运算前,确保所有几何对象使用相同的 `SpatialReference`
|
|
392
|
-
- **简化几何**:导入外部数据后,使用 `GeometryEngine.simplify()` 确保拓扑正确
|
|
393
|
-
- **大地测量 vs 平面**:经纬度距离用 `geodesicDistanceOnWGS84()`;椭球面积/长度算子未公开,建议改用 JTS/GeoTools
|
|
394
|
-
- **性能优化**:批量操作使用 `OperatorFactoryLocal` + `GeometryCursor`,而非逐个调用 `GeometryEngine` 静态方法
|
|
395
|
-
- **线程安全**:`GeometryEngine` 静态方法是线程安全的;`Operator` 实例非线程安全
|
|
381
|
+
- **加载与引用**:用 `skill("geometry-api-java")` 加载(用户也可输入 `/geometry-api-java`);本技能没有 `reference/` 子目录,示例都在正文;技能目录只读,Maven 工程建在会话工作区。
|
|
382
|
+
- **执行环境**:先 `mvn -v` 与 `java -version` 确认工具链(JDK 8+ 即可编译,建议 17/21 运行),Windows 上用 `pwsh` 执行;`%JAVA_HOME%`/`JAVA_HOME` 与 `mvn` 实际使用的 JDK 可能不同,报 `Unsupported class file major version` 时按 `mvn -v` 显示的 JDK 判断。
|
|
383
|
+
- **依赖坐标**:`com.esri.geometry:esri-geometry-api:2.2.4` 是 Maven Central 最新(2020-09 发布);上游 2.3.1(2026-10-09)未发布到 Central。先 `mvn dependency:get -Dartifact=com.esri.geometry:esri-geometry-api:2.2.4` 确认可解析,解析失败时报告“依赖不可下载”,不要自行改成 2.3.1 或别处坐标。
|
|
384
|
+
- **离线与网络**:首次 `mvn` 会拉依赖,无网或私服缺包时报 `Could not resolve dependencies`;不要为绕过它去改 `settings.xml`、加未知仓库或降级版本,先向用户要可用镜像。
|
|
385
|
+
- **验证产物**:写最小 main(或 JUnit)断言三件事——`geometryFromWkt` → `geometryToWkt` 往返等价、`GeometryEngine.buffer(poly, sr, 2.0)` 后 `getEnvelope()` 向外扩张、`geometryToGeoJson` 能被 `geoJsonToGeometry` 重新读入;`mvn -q -DskipTests package` 只证明能编译,不代表几何正确。
|
|
386
|
+
- **编译期陷阱**:`GeometryEngine` 没有 `intersects` 和 WKB 方法,分别用 `OperatorIntersects.local().execute(a, b, sr, null)` 与 `OperatorImportFromWkb`/`OperatorExportToWkb`;面积/长度用 `geometry.calculateArea2D()` / `calculateLength2D()`,不要去找 `getArea()`。
|
|
387
|
+
- **坐标与线程**:参与运算的几何必须带同一 `SpatialReference`;`GeometryEngine` 静态方法可并发调用,`Operator` 实例非线程安全,批量时用 `OperatorFactoryLocal` + `GeometryCursor` 并每线程持有自己的算子。
|
|
388
|
+
- **安全与权限**:`mvn` 会写 `~/.m2` 与工作区 `target/`,属预期行为;执行 `mvn install`/`deploy`、改动共享 `settings.xml` 或写入系统目录前先征得用户同意。
|
|
396
389
|
|
|
397
390
|
## 相关技能
|
|
398
391
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geometry-api-net
|
|
3
|
-
description: "Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in .NET/C# —
|
|
3
|
+
description: "Use when working with Esri geometry types (Point, Polyline, Polygon, Envelope) in .NET/C# — GeometryEngine, NuGet OpenGIS.Esri.Geometry.Core 1.0.9, WKT/EWKT, WKB, GeoJSON and Esri JSON I/O, System.Text.Json converters, geodesic distance; also for unclosed polygon rings, Geometry base-class casts after overlay, or the retired Esri/geometry-api-net repo. Esri Geometry API for .NET."
|
|
4
4
|
tags:
|
|
5
5
|
- dotnet
|
|
6
6
|
- geometry
|
|
@@ -304,23 +304,16 @@ dotnet run --project samples/OpenGIS.Esri.Geometry.Samples
|
|
|
304
304
|
|
|
305
305
|
---
|
|
306
306
|
|
|
307
|
-
##
|
|
307
|
+
## DeepSeek Harness 使用建议
|
|
308
308
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
1.
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
### 关键注意事项
|
|
318
|
-
|
|
319
|
-
- **Polygon 环必须闭合**:首尾点必须相同
|
|
320
|
-
- **返回类型需转换**:集合运算返回 `Geometry` 基类,需根据实际类型做类型转换
|
|
321
|
-
- **大地测量基于 WGS84**:`GeodesicDistance` 使用 Vincenty 公式
|
|
322
|
-
- **GeoJSON 导出规则**:单路径 Polyline 导出为 `LineString`,多路径导出为 `MultiLineString`
|
|
323
|
-
- **Operator 使用 Lazy 单例**:所有 Operator 类通过 `Instance` 属性获取单例实例
|
|
309
|
+
- **加载与引用**:用 `skill("geometry-api-net")` 加载(用户也可输入 `/geometry-api-net`);`reference/geometry-types.md` 按需 `read`,路径相对加载结果中的 Base directory;技能目录只读,示例工程建在会话工作区。
|
|
310
|
+
- **执行环境**:先 `dotnet --version`(库目标 `netstandard2.0`,可被 net6/net8/net9/net10 引用);Windows 上用 `pwsh` 执行 `dotnet` 命令,`dotnet new console -o demo && cd demo` 建最小工程。
|
|
311
|
+
- **依赖坐标**:`dotnet add package OpenGIS.Esri.Geometry.Core --version 1.0.9`(NuGet 最新 1.0.9,2026-09-21),需要 `System.Text.Json` 转换器时再装 `OpenGIS.Esri.Geometry.Json`;还原失败报 `NU1101` 说明源或版本不可用,报告“依赖不可下载”,不要自己编版本号。
|
|
312
|
+
- **验证产物**:最小控制台程序断言三件事——`GeometryEngine.GeometryFromWkt` → `GeometryToWkt` 往返、`GeometryEngine.Contains(polygon, point)` 返回 true、`GeometryEngine.Buffer(point, 5.0).GetEnvelope()` 为 (XMin=5,YMin=15,XMax=15,YMax=25),再 `dotnet run` 看实际输出;`dotnet build` 成功不代表几何结果正确。
|
|
313
|
+
- **构建与测试**:`dotnet build` 编译、`dotnet test` 跑 xUnit、`dotnet run --project samples/OpenGIS.Esri.Geometry.Samples` 跑示例(需在仓库 checkout 内,且该路径存在);输出在 `bin/`、`obj/`,不要提交。
|
|
314
|
+
- **编译期陷阱**:`Polygon.AddRing` 必须闭合(首尾点相同)否则面积/包含判断异常;集合运算返回 `Geometry` 基类,要按 `Point`/`Polygon` 转型后再用;容差 `GeometryConstants.DefaultTolerance`(1e-10)是内部常量,无法外部调整。
|
|
315
|
+
- **大地测量前提**:`GeodesicDistance`/`GeodesicArea` 基于 WGS84(Vincenty),输入必须是经纬度;对投影坐标(如 EPSG:3857 米制)调用会得到无意义结果。
|
|
316
|
+
- **安全与权限**:`dotnet restore` 需访问 NuGet 源,离线时先确认本地缓存;修改全局 `NuGet.config`、安装 SDK 或写入系统目录前先征得用户同意,命令输出里不要回显私有源凭据。
|
|
324
317
|
|
|
325
318
|
## 常见问题
|
|
326
319
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: geopandas
|
|
3
|
-
description: "Use when
|
|
3
|
+
description: "Use when doing vector spatial analysis in Python — gpd.read_file/to_file via pyogrio (GPKG, Shapefile, GeoParquet), sjoin/sjoin_nearest, overlay, clip, dissolve, to_crs vs set_crs, gdf.plot choropleth; also for CRSError from a missing PROJ data dir, area/distance computed in degrees, or GeoDataFrame geometry-column conflicts. GeoPandas 1.2.0 extends pandas DataFrames with geometry columns."
|
|
4
4
|
tags:
|
|
5
5
|
- python
|
|
6
6
|
- pandas
|
|
@@ -356,24 +356,16 @@ m = gdf.explore(column="population", cmap="viridis",
|
|
|
356
356
|
| `DriverError` 无法写入 | 驱动不支持或文件被占用 | 检查驱动名拼写、关闭已打开的文件 |
|
|
357
357
|
| `align=True` 导致意外 NaN | 二元操作默认按索引对齐 | 传入 `align=False` 或重置索引 |
|
|
358
358
|
|
|
359
|
-
##
|
|
359
|
+
## DeepSeek Harness 使用建议
|
|
360
360
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
### 关键注意事项
|
|
370
|
-
|
|
371
|
-
- **`set_crs()` vs `to_crs()`**:`set_crs()` 仅标记坐标系不转换坐标,`to_crs()` 执行实际坐标变换——切勿混用
|
|
372
|
-
- **面积/距离计算前投影**:地理坐标系(EPSG:4326)下面积单位为度²无意义,应使用 `gdf.to_crs(gdf.estimate_utm_crs())` 投影后再计算
|
|
373
|
-
- **空间操作前统一 CRS**:确保参与 `sjoin`、`overlay`、`clip` 的所有 GeoDataFrame 使用相同 CRS
|
|
374
|
-
- **优先使用 GeoParquet**:比 Shapefile/GeoJSON 读写快 5-10 倍,且无字段名长度限制
|
|
375
|
-
- **向量化操作**:避免逐行循环,使用 GeoSeries 的向量化方法(`buffer()`、`intersection()` 等)批量处理
|
|
376
|
-
- **空间索引自动构建**:`.sindex` 自动维护 STRtree,`query()` 和 `nearest()` 可大幅加速空间查询
|
|
361
|
+
- **加载与引用**:用 `skill("geopandas")` 加载(用户也可输入 `/geopandas`);`reference/core-api.md` 按需 `read`,路径相对加载结果中的 Base directory;技能目录只读,脚本与产物写到会话工作区。
|
|
362
|
+
- **执行环境**:命令交给 dsh 的 shell 工具(Windows 用 `pwsh`,仅暴露 `run_code` 的会话在 `tools.pwsh` 里跑);不要假设 `python` 是 QGIS/GDAL 自带的解释器,先 `python -c "import sys; print(sys.executable, sys.version)"`。
|
|
363
|
+
- **先探测版本**:`python -c "import geopandas as gpd; print(gpd.__version__, gpd.options.io_engine)"`;本技能按 1.2.0 / Python >= 3.11 编写,低版本会缺 `to_arrow`、`to_parquet(geometry_encoding=...)` 与 1.2 新绘图参数(`tiles=`、`legend_kwds={"colorbar": True}`),回答时说明差异而不是硬写。
|
|
364
|
+
- **检查依赖后端**:`python -c "import pyogrio, pyproj; print(pyogrio.__version__, pyproj.__version__, pyproj.datadir.get_data_dir())"`;PROJ 数据目录缺失时 `to_crs("EPSG:3857")` 抛 `CRSError: Invalid projection`,装 `pyproj`/`pyogrio` 前先征得用户同意。
|
|
365
|
+
- **验证产物(必做)**:写完立即重开核对,`gdf = gpd.read_file("out.gpkg", layer="result"); print(gdf.crs, len(gdf), gdf.is_valid.all(), gdf.total_bounds)`,并确认面积/长度是在投影坐标系下算的。
|
|
366
|
+
- **落图后看图**:`ax = gdf.plot(column="pop", legend=True, figsize=(12, 8)); ax.figure.savefig("map.png", dpi=100)`(需 matplotlib),再用 `read_image("map.png")` 检查范围、图例与空几何,不要只凭退出码报告成功。
|
|
367
|
+
- **典型误操**:`set_crs()` 只标记不改坐标、`to_file()` 默认整表覆盖、`to_postgis(if_exists="replace")` 会删表重建——执行前确认目标路径/表名,Shapefile 字段名超 10 字符会被截断,改用 `.gpkg`。
|
|
368
|
+
- **安全**:数据库连接串里的密码不要回显在命令输出里;`pip install geopandas[all]`、写入系统目录或覆盖生产数据前先得到用户确认。
|
|
377
369
|
|
|
378
370
|
## 相关技能
|
|
379
371
|
|