@dsh-gis/dsh-opengis-skill 0.2.0 → 0.4.0

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.
Files changed (126) hide show
  1. package/CHANGELOG.md +126 -1
  2. package/README.md +51 -25
  3. package/adaptations/brutile.md +6 -6
  4. package/adaptations/cesiumjs.md +6 -6
  5. package/adaptations/common.md +20 -13
  6. package/adaptations/deck-gl.md +6 -6
  7. package/adaptations/duckdb-spatial.md +6 -6
  8. package/adaptations/gdal-api.md +6 -6
  9. package/adaptations/gdal.md +6 -6
  10. package/adaptations/geolibre.md +6 -6
  11. package/adaptations/geometry-api-java.md +6 -6
  12. package/adaptations/geometry-api-net.md +6 -6
  13. package/adaptations/geonode.md +6 -6
  14. package/adaptations/geopandas.md +6 -6
  15. package/adaptations/geopipe-agent.md +6 -6
  16. package/adaptations/geos.md +8 -0
  17. package/adaptations/geoserver-cloud.md +6 -6
  18. package/adaptations/geoserver-rest-api.md +6 -6
  19. package/adaptations/geoserver.md +6 -6
  20. package/adaptations/geotools.md +6 -6
  21. package/adaptations/grass-gis.md +6 -6
  22. package/adaptations/jts.md +6 -6
  23. package/adaptations/kepler-gl.md +6 -6
  24. package/adaptations/leaflet.md +6 -6
  25. package/adaptations/mapbox-gl-js.md +6 -6
  26. package/adaptations/maplibre-gl-js.md +8 -0
  27. package/adaptations/maplibre-native.md +8 -0
  28. package/adaptations/mapserver.md +6 -6
  29. package/adaptations/mapsui.md +6 -6
  30. package/adaptations/nettopologysuite.md +6 -6
  31. package/adaptations/opendronemap.md +8 -0
  32. package/adaptations/opengis-all.md +7 -6
  33. package/adaptations/opengis-daf.md +7 -6
  34. package/adaptations/opengis-utils-for-java.md +6 -6
  35. package/adaptations/opengis-utils-for-net.md +6 -6
  36. package/adaptations/openlayers.md +6 -6
  37. package/adaptations/pdal.md +6 -6
  38. package/adaptations/postgis.md +6 -6
  39. package/adaptations/proj.md +6 -6
  40. package/adaptations/projnet4geoapi.md +6 -6
  41. package/adaptations/pyqgis.md +6 -6
  42. package/adaptations/qgis-process.md +6 -6
  43. package/adaptations/qgis-server.md +6 -6
  44. package/adaptations/shapely.md +6 -6
  45. package/adaptations/sharpmap.md +6 -6
  46. package/adaptations/spatialite.md +6 -6
  47. package/adaptations/stac-cog-titiler.md +8 -0
  48. package/adaptations/whitebox-tools.md +6 -6
  49. package/assets/brutile/SKILL.md +6 -12
  50. package/assets/cesiumjs/SKILL.md +14 -18
  51. package/assets/deck-gl/SKILL.md +9 -15
  52. package/assets/duckdb-spatial/SKILL.md +41 -25
  53. package/assets/gdal/SKILL.md +11 -18
  54. package/assets/gdal/reference/raster-tools.md +14 -0
  55. package/assets/gdal/reference/vector-tools.md +5 -0
  56. package/assets/gdal-api/SKILL.md +8 -16
  57. package/assets/gdal-api/reference/raster-api.md +7 -0
  58. package/assets/gdal-api/reference/vector-api.md +9 -0
  59. package/assets/geolibre/SKILL.md +11 -17
  60. package/assets/geometry-api-java/SKILL.md +5 -10
  61. package/assets/geometry-api-net/SKILL.md +5 -11
  62. package/assets/geometry-api-net/reference/geometry-types.md +5 -0
  63. package/assets/geonode/SKILL.md +8 -15
  64. package/assets/geopandas/SKILL.md +46 -17
  65. package/assets/geopandas/reference/core-api.md +55 -0
  66. package/assets/geopipe-agent/SKILL.md +7 -14
  67. package/assets/geopipe-agent/reference/steps-reference.md +12 -0
  68. package/assets/geopipe-agent/reference/workflows.md +8 -0
  69. package/assets/geos/SKILL.md +372 -0
  70. package/assets/geoserver/SKILL.md +6 -13
  71. package/assets/geoserver-cloud/SKILL.md +12 -21
  72. package/assets/geoserver-rest-api/SKILL.md +5 -12
  73. package/assets/geoserver-rest-api/reference/endpoints.md +16 -0
  74. package/assets/geotools/SKILL.md +5 -12
  75. package/assets/geotools/reference/raster-rendering.md +5 -0
  76. package/assets/geotools/reference/vector-io.md +7 -0
  77. package/assets/grass-gis/SKILL.md +36 -18
  78. package/assets/jts/SKILL.md +5 -12
  79. package/assets/jts/reference/geometry-operations.md +13 -0
  80. package/assets/kepler-gl/SKILL.md +10 -16
  81. package/assets/leaflet/SKILL.md +19 -23
  82. package/assets/mapbox-gl-js/SKILL.md +11 -16
  83. package/assets/maplibre-gl-js/SKILL.md +478 -0
  84. package/assets/maplibre-native/SKILL.md +383 -0
  85. package/assets/mapserver/SKILL.md +12 -16
  86. package/assets/mapsui/SKILL.md +29 -18
  87. package/assets/nettopologysuite/SKILL.md +5 -11
  88. package/assets/opendronemap/SKILL.md +309 -0
  89. package/assets/opengis-all/SKILL.md +14 -19
  90. package/assets/opengis-all/reference/data-stages.md +7 -0
  91. package/assets/opengis-all/reference/workflow-cheatsheets.md +7 -0
  92. package/assets/opengis-daf/SKILL.md +5 -13
  93. package/assets/opengis-utils-for-java/SKILL.md +7 -11
  94. package/assets/opengis-utils-for-java/reference/common-tasks.md +4 -0
  95. package/assets/opengis-utils-for-net/SKILL.md +5 -10
  96. package/assets/opengis-utils-for-net/reference/code-patterns.md +4 -0
  97. package/assets/opengis-utils-for-net/reference/util-classes.md +10 -0
  98. package/assets/openlayers/SKILL.md +16 -20
  99. package/assets/pdal/SKILL.md +15 -13
  100. package/assets/postgis/SKILL.md +21 -26
  101. package/assets/proj/SKILL.md +5 -12
  102. package/assets/projnet4geoapi/SKILL.md +6 -12
  103. package/assets/pyqgis/SKILL.md +5 -10
  104. package/assets/pyqgis/reference/processing-rendering.md +6 -0
  105. package/assets/pyqgis/reference/vector-raster-layers.md +6 -0
  106. package/assets/qgis-process/SKILL.md +5 -12
  107. package/assets/qgis-process/reference/algorithm-cheatsheet.md +6 -0
  108. package/assets/qgis-server/SKILL.md +7 -13
  109. package/assets/shapely/SKILL.md +29 -14
  110. package/assets/shapely/reference/operations-reference.md +42 -0
  111. package/assets/sharpmap/SKILL.md +5 -11
  112. package/assets/spatialite/SKILL.md +15 -16
  113. package/assets/stac-cog-titiler/SKILL.md +420 -0
  114. package/assets/whitebox-tools/SKILL.md +28 -19
  115. package/lib/adaptations.d.ts +18 -0
  116. package/lib/adaptations.js +164 -7
  117. package/lib/catalog.d.ts +7 -1
  118. package/lib/catalog.js +9 -1
  119. package/lib/index.d.ts +9 -0
  120. package/lib/index.js +48 -3
  121. package/lib/skill-file.d.ts +12 -0
  122. package/lib/skill-file.js +107 -16
  123. package/locale/en.json +1 -1
  124. package/locale/zh.json +1 -1
  125. package/package.json +8 -3
  126. package/upstream.json +74 -64
@@ -1,25 +1,21 @@
1
1
  ---
2
2
  name: pdal
3
3
  description: "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."
4
- tags:
5
- - pdal
6
- - point-cloud
7
- - lidar
8
- - las
9
- - laz
10
- - pipeline
11
- - dem
12
- - gis
13
- - geospatial
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "pdal, point-cloud, lidar, las, laz, pipeline, dem, gis, geospatial"
14
8
  ---
15
9
 
16
10
  > **项目地址:** <https://github.com/PDAL/PDAL>
17
11
  >
18
12
  > **官方文档:** <https://pdal.io/>
19
13
  >
20
- > **Conda:** `pdal` / `python-pdal`(conda-forge,最新 2.10.2,截至 2026-10)
14
+ > **最新版本:** 2.10.2(截至 2026-11,[GitHub Release](https://github.com/PDAL/PDAL/releases);conda-forge `pdal` 同为 2.10.2)
21
15
  >
22
- > **PyPI:** `pdal`(Python 绑定,最新 3.5.5,截至 2026-10;版本号与主库独立)
16
+ > **构建依赖:** 最低要求 GDAL 3.8(`cmake/gdal.cmake` 里硬校验;发行版二进制包已自带匹配的 GDAL,无需自己编)
17
+ >
18
+ > **PyPI:** `pdal`(Python 绑定,最新 3.5.5,截至 2026-11;版本号与主库独立)
23
19
  >
24
20
  > **许可证:** BSD-3-Clause
25
21
 
@@ -31,6 +27,7 @@ PDAL(Point Data Abstraction Library)是处理点云数据的开源库与命
31
27
  - **流式优先**:默认尽量使用 stream mode,大文件不必整体载入
32
28
  - **格式广泛**:内置 LazPerf,LAZ 压缩读写开箱即用
33
29
  - **生态衔接**:writers.gdal 直接输出 GeoTIFF DEM,Python 绑定返回 NumPy 数组
30
+ - **2.10 新增 stage**:`filters.m3c2`(3D 变化检测,带四叉树 PointGrid 索引)、`filters.radiusassign`(按半径条件赋值);writers.gdal 支持 `p<percentile>` 百分位波段,filters.hag_dem 新增 `min_clamp` / `max_clamp` / `nodata`
34
31
 
35
32
  ## 环境准备
36
33
 
@@ -214,7 +211,8 @@ pdal pipeline pipeline.json --stage.points.filename=data.laz # 按 tag 覆盖
214
211
  ```
215
212
 
216
213
  - `resolution` 必需(格网边长);`dimension` 默认 `Z`
217
- - `output_type` 可选 `min/max/mean/idw/count/stdev/all`(默认 `all`,输出多波段)
214
+ - `output_type` 可选 `min/max/mean/idw/count/stdev/all`(默认 `all`,输出多波段);2.10 起还支持 `p<percentile>` 百分位波段(如 `p95`),百分位波段不计入 `all`
215
+ - `binmode`(默认 false)为 true 时只统计落在像元内的点,不做距离插值
218
216
  - `gdalopts` 透传 GDAL 驱动参数;`override_srs` 指定输出栅格坐标系
219
217
 
220
218
  ### Python 绑定
@@ -314,6 +312,8 @@ for las_file in glob.glob("tiles/*.las"):
314
312
  - 输出统一用 LAZ(`compression: "true"`)减小体积,GDAL/QGIS 可直接读取
315
313
  - 用 `tag` + `inputs` 构建分支与合并(filters.merge),tag 必须先定义
316
314
  - `pdal ground` 自 2.6.0 标记 DEPRECATED,2.7 从默认安装移除、2.8 完全移除;一律改用 `filters.smrf` 的 pipeline 写法
315
+ - `readers.spz` / `writers.spz` 在 2.10 变成插件:标准安装里 `pdal --drivers` 看不到它们,需要 SPZ 支持时另装对应插件
316
+ - 2.10 起 `filters.georeference` 输出 ECEF(EPSG:4978),要经纬度结果需再接 `filters.reprojection`
317
317
  - SMRF 参数需按数据调整:window 参考最大建筑物尺寸,slope/threshold 可参考 SMRF 论文的参数组合
318
318
 
319
319
  ## 常见问题
@@ -329,6 +329,8 @@ for las_file in glob.glob("tiles/*.las"):
329
329
  | 重投影后坐标精度变差 | 在 writer 中设置 `scale_x/y/z` 与 `offset_x/y/z: "auto"` |
330
330
  | 地面分类效果不佳 | 调整 smrf 的 window/slope/threshold/scalar,先检查数据坐标系与高程单位 |
331
331
  | 报 `Couldn't create <cls> stage of type '<type>'.` | stage 名拼错或该版本没有此 stage:先 `pdal --drivers` 确认存在,再核对 `readers.*`/`filters.*`/`writers.*` 前缀 |
332
+ | 编译报 `Could not find GDAL` / `Required at least GDAL version 3.8` | PDAL 当前最低要求 GDAL 3.8,版本低于它 CMake 直接报错 | 升级 GDAL,或直接用 conda-forge / Docker 二进制包省去编译 |
333
+ | 用 `filters.range` 时收到建议迁移的提示 | 官方建议 2.5.x+ 新代码用 `filters.expression`,`filters.range` 自 PDAL 3.0 起弃用 | 新 pipeline 一律写 `{"type": "filters.expression", "expression": "..."}` |
332
334
 
333
335
  ## AI 使用建议
334
336
 
@@ -1,24 +1,17 @@
1
1
  ---
2
2
  name: postgis
3
- description: "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."
4
- tags:
5
- - postgresql
6
- - database
7
- - sql
8
- - spatial
9
- - geometry
10
- - geography
11
- - raster
12
- - vector
13
- - wkt
14
- - wkb
3
+ description: "Use when extending PostgreSQL with PostGIS 3.7.0 — geometry/geography/raster types, GiST and KNN distance-operator 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."
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "postgresql, database, sql, spatial, geometry, geography, raster, vector, wkt, wkb"
15
8
  ---
16
9
 
17
10
  > **项目地址:** <https://github.com/postgis/postgis>
18
11
  >
19
12
  > **官方文档:** <https://postgis.net/docs/>
20
13
  >
21
- > **最新版本:** 3.6.4(截至 2026-10,[Releases](https://github.com/postgis/postgis/releases));3.7 系列已到 3.7.0rc3,尚未正式发布
14
+ > **最新版本:** 3.7.0(2026-10-30 发布,截至 2026-11;[发布公告](https://postgis.net/2026/10/PostGIS-3.7.0/)、[3.7 手册](https://postgis.net/docs/manual-3.7/en/))
22
15
  >
23
16
  > **许可证:** GPL-2.0+
24
17
 
@@ -32,7 +25,7 @@ PostGIS 是基于 PostgreSQL 的开源空间数据库扩展,遵循 OGC Simple
32
25
  - **坐标参考系**:内置 6000+ EPSG 投影,自动 ST_Transform
33
26
  - **数据导入导出**:与 GDAL/ogr2ogr/shp2pgsql 无缝集成
34
27
 
35
- **版本要求:** PostgreSQL 12–18 配合 PostGIS 3.x(最新稳定版 3.6.4;3.7 仍处 RC 阶段,候选版为 3.7.0rc3,截至 2026-10);GEOS ≥ 3.8(部分新算子需 GEOS ≥ 3.14)
28
+ **版本要求:** PostGIS 3.7 要求 PostgreSQL 14–19、GEOS ≥ 3.10、PROJ ≥ 6.1、libgmp(要启用全部扩展需 GEOS ≥ 3.15、SFCGAL ≥ 2.3);PostGIS 3.6 及更早版本仍可配 PostgreSQL 12+,升级前先确认 GEOS/PROJ 满足新下限
36
29
 
37
30
  ---
38
31
 
@@ -44,14 +37,14 @@ PostGIS 是基于 PostgreSQL 的开源空间数据库扩展,遵循 OGC Simple
44
37
  # Debian/Ubuntu
45
38
  sudo apt install postgresql-17-postgis-3 postgresql-17-postgis-3-scripts
46
39
 
47
- # CentOS/RHEL
48
- sudo yum install postgis36_17
40
+ # CentOS/RHEL(PGDG 仓库;包名格式 postgis<PostGIS 主版本>_<PG 主版本>)
41
+ sudo yum install postgis37_17
49
42
 
50
43
  # macOS
51
44
  brew install postgis
52
45
 
53
46
  # Docker(推荐,标签格式 <PG 主版本>-<PostGIS 主版本>)
54
- docker run --name pg -e POSTGRES_PASSWORD=pg -p 5432:5432 -d postgis/postgis:17-3.6
47
+ docker run --name pg -e POSTGRES_PASSWORD=pg -p 5432:5432 -d postgis/postgis:17-3.7
55
48
  ```
56
49
 
57
50
  ### 启用扩展
@@ -268,21 +261,23 @@ SELECT count(*) FROM poi AS p JOIN districts AS d
268
261
 
269
262
  ## 常见问题
270
263
 
271
- | 问题 | 解决方案 |
272
- |------|---------|
273
- | 查询慢 | 建索引 + `ANALYZE` + 检查 `EXPLAIN` |
274
- | `Operation on mixed SRID` | 统一 SRID:`ST_SetSRID/ST_Transform` |
275
- | 距离单位不对 | 投影下是度,需转 `geography` 或投到米制 |
276
- | 跨经线 180° 异常 | 改用 `geography` |
277
- | 多边形无效 | `ST_MakeValid` 修复,`ST_IsValidReason` 诊断 |
278
- | `CREATE EXTENSION postgis` 报错(找不到扩展文件) | 安装对应 PostgreSQL 版本的 `postgis-<pgver>` 软件包后重试 |
264
+ | 报错 / 现象 | 原因 | 处置 |
265
+ |------|------|------|
266
+ | 报错 `ERROR: Operation on mixed SRID geometries` | 运算两侧几何的 SRID 不一致(`geometry` 类型下 PostGIS 不做隐式转换) | 先统一 SRID:`ST_Transform(geom, 4326)`(换坐标系)或 `ST_SetSRID(geom, 4326)`(只标注不改坐标);用 `ST_SRID(geom)` 逐列核对 |
267
+ | 报错 `ERROR: Boundary geometry is invalid` / `Input Geometry contains invalid coordinates`(GEOS 触发的自相交多边形) | 多边形自相交、重复点或环未闭合,GEOS 精确算子在无效几何上会直接报错 | 用 `ST_IsValidReason(geom)` 定位、`ST_MakeValid(geom)` 修复后入库;长期方案是入库前校验 |
268
+ | 输出几何报 `transform: Failed to transform` 或 `couldn't project point` | `ST_Transform` 找不到目标 SRID,或 PROJ 缺少所需网格/参数 | 确认 `spatial_ref_sys` 中存在目标 SRID,且 PROJ 数据完整(`projinfo EPSG:<code>` 能解析);缺网格时安装 proj-data |
269
+ | 报错 `ERROR: type "geometry" does not exist` | 扩展没装,或装在别的 schema/数据库 | 在当前库执行 `CREATE EXTENSION postgis;`;确认 `search_path` 包含扩展所在 schema |
270
+ | 报错 `ERROR: could not open extension control file .../postgis.control` | PostgreSQL 版本与 PostGIS 软件包主版本不匹配 | 安装与 PostgreSQL 主版本对应的包(如 `postgis37_17` 对应 PG 17),必要时 `ALTER EXTENSION postgis UPDATE;` |
271
+ | 查询慢(全表扫描) | 缺 GiST 索引、几何经过函数包裹导致索引失效,或统计信息过期 | `CREATE INDEX ... USING GIST (geom)`;用 `geom && ST_MakeEnvelope(...)` 先走索引再精筛;大批量导入后 `VACUUM ANALYZE`;用 `EXPLAIN (ANALYZE, BUFFERS)` 验证 |
272
+ | 距离 / 面积数值明显偏大或偏小 | 在经纬度(4326)上直接 `ST_Distance`/`ST_Area`,单位是「度」 | 改用 `geography`(`geom::geography`,单位米)或先投影到米制 CRS 再计算 |
273
+ | 跨 180° 经线附近结果异常 | 平面几何在 ±180° 处被切开 | 用 `geography`,或先 `ST_ShiftLongitude` 把范围调整到 0–360° |
279
274
 
280
275
  ---
281
276
 
282
277
  ## AI 使用建议
283
278
 
284
279
  - **执行环境**:命令在终端 / shell 中执行(Windows 用 `psql.exe`,或 `docker exec -i pg psql -U postgres`);psql 元命令(`\d`、`\c`)用 `psql -c "\d poi"` 单条传入,别依赖交互式会话。
285
- - **先探测版本**:`psql -c "SELECT version(), PostGIS_Full_Version();"` 核对 PostgreSQL、PostGIS 3.6.4 与 GEOS/PROJ;扩展缺失时先看 `SELECT * FROM pg_available_extensions WHERE name LIKE 'postgis%';`。
280
+ - **先探测版本**:`psql -c "SELECT version(), PostGIS_Full_Version();"` 核对 PostgreSQL、PostGIS 3.7.0 与 GEOS/PROJ;扩展缺失时先看 `SELECT * FROM pg_available_extensions WHERE name LIKE 'postgis%';`。
286
281
  - **验证产物**:导入后别只看 `INSERT 0 n`,跑 `SELECT count(*), ST_SRID(geom), ST_IsValid(geom) FROM t GROUP BY 2,3;` 核对要素数、SRID 与无效几何;性能结论必须用 `EXPLAIN (ANALYZE, BUFFERS)` 证明索引被使用。
287
282
  - **写操作回读**:`CREATE/ALTER`、`UpdateGeometrySRID` 或批量 `UPDATE` 后回读 `\d+ t` 与 `geometry_columns`,确认列类型与 SRID 真的落库。
288
283
  - **安全与权限**:密码不要写进命令行或报告(用 `PGPASSWORD`/`.pgpass`/连接串环境变量);`DROP TABLE/SCHEMA`、整表改写 geom、`VACUUM FULL`、重启 PostgreSQL 前必须先向用户确认并备份。
@@ -1,17 +1,10 @@
1
1
  ---
2
2
  name: proj
3
3
  description: "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."
4
- tags:
5
- - proj
6
- - crs
7
- - coordinate-transformation
8
- - reprojection
9
- - epsg
10
- - projinfo
11
- - cs2cs
12
- - geodesy
13
- - wkt
14
- - gis
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "proj, crs, coordinate-transformation, reprojection, epsg, projinfo, cs2cs, geodesy, wkt, gis"
15
8
  ---
16
9
 
17
10
  > **项目地址:** <https://github.com/OSGeo/PROJ>
@@ -20,7 +13,7 @@ tags:
20
13
  >
21
14
  > **命令行文档:** <https://proj.org/en/stable/apps/index.html>
22
15
  >
23
- > **最新版本:** 9.9.0(截至 2026-10)
16
+ > **最新版本:** 9.9.0(截至 2026-11,[GitHub Release](https://github.com/OSGeo/PROJ/releases))
24
17
  >
25
18
  > **许可证:** MIT
26
19
 
@@ -1,21 +1,15 @@
1
1
  ---
2
2
  name: projnet4geoapi
3
3
  description: "Use when transforming coordinates or reading CRS definitions in .NET with ProjNet 2.1.0 (NuGet ProjNet, repo ProjNet4GeoAPI) — CoordinateSystemFactory.CreateFromWkt, CoordinateTransformationFactory.CreateFromCoordinateSystems, MathTransform.Transform, CoordinateSystemServices SRID registration. Also for 'no suitable transformation' / null from GetCoordinateSystem, EPSG codes beyond 4326 and 3857 returning null, and SharpMap projects needing the legacy ProjNet4GeoAPI 1.4.1 GeoAPI build."
4
- tags:
5
- - dotnet
6
- - csharp
7
- - coordinate-systems
8
- - projection
9
- - epsg
10
- - wkt
11
- - geospatial
12
- - netstandard
13
- - sharpmap
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "dotnet, csharp, coordinate-systems, projection, epsg, wkt, geospatial, netstandard, sharpmap"
14
8
  ---
15
9
 
16
10
  > **项目地址:** <https://github.com/NetTopologySuite/ProjNet4GeoAPI>
17
11
  >
18
- > **NuGet(2.x):** `ProjNet` 2.1.0(netstandard2.0 / netstandard2.1,截至 2026-10)
12
+ > **最新版本:** 2.1.0(截至 2026-11,[NuGet `ProjNet`](https://www.nuget.org/packages/ProjNet),netstandard2.0 / netstandard2.1)
19
13
  >
20
14
  > **NuGet(1.x,旧版):** `ProjNet4GeoAPI` 1.4.1(面向 GeoAPI 接口的项目,如 SharpMap 1.2)
21
15
  >
@@ -144,7 +138,7 @@ IList<double[]> projectedPoints = mt.TransformList(points);
144
138
  | `MathTransform.Transform(double[])` | 单点转换,输入 `[x, y]` 或 `[x, y, z]`,维度由变换决定 |
145
139
  | `MathTransform.Transform(double x, double y)` | 元组重载,返回 `(x, y)` |
146
140
  | `MathTransform.TransformList(IList<double[]>)` | 批量转换,返回转换后的点数组列表 |
147
- | `MathTransform.Transform(Span<double> xs, Span<double> ys)` | 分离数组的 SOA 批量转换,适合大数组 |
141
+ | `MathTransform.Transform(Span<double> xs, Span<double> ys, int strideX = 1, int strideY = 1)` | 分离数组的 SOA 批量转换,适合大数组;数组有交错间隔时用 `strideX`/`strideY` 指定步长 |
148
142
  | `MathTransform.Inverse()` | 取逆变换,用于反向换算 |
149
143
 
150
144
  坐标按 `x, y` 顺序解释(经度/东坐标在前,纬度/北坐标在后),ProjNet **不做轴序交换**;若拿到的 WKT 声明了 `AXIS["Latitude", NORTH]` 之类的轴序,需要调用方自行判断是否交换。
@@ -1,15 +1,10 @@
1
1
  ---
2
2
  name: pyqgis
3
3
  description: "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 (use the interpreter bundled with QGIS, not system Python)."
4
- tags:
5
- - python
6
- - qgis
7
- - gis
8
- - processing
9
- - vector
10
- - raster
11
- - rendering
12
- - plugin
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "python, qgis, gis, processing, vector, raster, rendering, plugin"
13
8
  ---
14
9
 
15
10
  > **项目地址:** <https://github.com/qgis/QGIS>
@@ -18,7 +13,7 @@ tags:
18
13
  >
19
14
  > **Python API 参考:** <https://qgis.org/pyqgis/4.2/>
20
15
  >
21
- > **最新版本:** QGIS 4.2.3(截至 2026-10,[下载页](https://qgis.org/download/));LTR 3.44.15
16
+ > **最新版本:** QGIS 4.2.3(截至 2026-11,[下载页](https://qgis.org/download/));LTR 3.44.15
22
17
  >
23
18
  > **许可证:** GPL-2.0+
24
19
 
@@ -1,5 +1,11 @@
1
1
  # PyQGIS Processing, Rendering and Workflows Reference
2
2
 
3
+ ## Contents
4
+
5
+ - Processing 算法调用
6
+ - 地图渲染与导出
7
+ - 典型工作流示例
8
+
3
9
  > 这是 [../SKILL.md](../SKILL.md) 的补充文件,收录 Processing 算法调用、地图渲染/导出与典型工作流示例。
4
10
 
5
11
  ---
@@ -1,5 +1,11 @@
1
1
  # PyQGIS Vector and Raster Layer Operations Reference
2
2
 
3
+ ## Contents
4
+
5
+ - 矢量图层操作
6
+ - 栅格图层操作
7
+ - 几何操作
8
+
3
9
  > 这是 [../SKILL.md](../SKILL.md) 的补充文件,收录矢量/栅格图层操作的完整 API 与示例。
4
10
 
5
11
  ---
@@ -1,17 +1,10 @@
1
1
  ---
2
2
  name: qgis-process
3
3
  description: "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)."
4
- tags:
5
- - cli
6
- - qgis
7
- - processing
8
- - raster
9
- - automation
10
- - batch
11
- - ci-cd
12
- - json
13
- - workflow
14
- - shell
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "cli, qgis, processing, raster, automation, batch, ci-cd, json, workflow, shell"
15
8
  ---
16
9
 
17
10
  > **项目地址:** <https://github.com/qgis/QGIS>
@@ -20,7 +13,7 @@ tags:
20
13
  >
21
14
  > **在线文档:** <https://docs.qgis.org/4.2/en/docs/user_manual/processing/standalone.html>
22
15
  >
23
- > **最新版本:** QGIS 4.2.3;3.44 LTR 最新 3.44.15(截至 2026-10,GitHub Releases;`qgis_process` 自 QGIS 3.16 起可用)
16
+ > **最新版本:** QGIS 4.2.3;3.44 LTR 最新 3.44.15(截至 2026-11,[GitHub Releases](https://github.com/qgis/QGIS/releases)、[下载页](https://qgis.org/download/);`qgis_process` 自 QGIS 3.16 起可用)
24
17
  >
25
18
  > **许可证:** GPL-2.0+
26
19
 
@@ -1,5 +1,11 @@
1
1
  # QGIS Process Algorithm Cheatsheet Reference
2
2
 
3
+ ## Contents
4
+
5
+ - 常用内置算法速查
6
+ - 参数类型参考
7
+ - 典型工作流示例
8
+
3
9
  Built-in algorithm cheatsheet, parameter types and typical workflow examples split from SKILL.md.
4
10
 
5
11
  ---
@@ -1,23 +1,17 @@
1
1
  ---
2
2
  name: qgis-server
3
3
  description: "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."
4
- tags:
5
- - qgis
6
- - server
7
- - wms
8
- - wfs
9
- - wmts
10
- - ogc
11
- - fcgi
12
- - map
13
- - web
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "qgis, server, wms, wfs, wmts, ogc, fcgi, map, web"
14
8
  ---
15
9
 
16
10
  > **项目地址:** <https://github.com/qgis/QGIS>
17
11
  >
18
- > **官方文档:** <https://docs.qgis.org/3.44/en/docs/server_manual/>(`/latest/` 目前 302 到 3.44 手册,4.2 手册尚未单独发布)
12
+ > **官方文档:** <https://docs.qgis.org/4.2/en/docs/server_manual/>(4.2 文档挂在 `/testing/` 路径下;`/latest/` 重定向到 3.44 LTR 手册,查 LTR 行为时用 <https://docs.qgis.org/3.44/en/docs/server_manual/>)
19
13
  >
20
- > **最新版本:** 4.2.3(稳定版);LTR 3.44.15(截至 2026-10,实测 `qgis/qgis` 镜像 tag 与 <https://qgis.org/download/>)
14
+ > **最新版本:** 4.2.3(官网 Latest Release);LTR 3.44.15(截至 2026-11,实测 `qgis/qgis` 镜像 tag 与 <https://qgis.org/download/>)
21
15
  >
22
16
  > **许可证:** GPL-2.0
23
17
 
@@ -187,7 +181,7 @@ location /qgis {
187
181
 
188
182
  1. **版本对齐**:QGIS Server 与生成项目的 QGIS Desktop 尽量使用相同主版本;跨大版本打开旧项目可能因图层/表达式不兼容而报错。生产环境优先 LTR。
189
183
  2. **优先 `.qgz`**:`.qgz` 是压缩的单文件项目,便于分发并避免路径遗漏;配合 `QGIS_PROJECT_FILE` 固定默认项目。
190
- 3. **日志走 stderr**:使用 `QGIS_SERVER_LOG_STDERR` 交给系统日志收集,`QGIS_SERVER_LOG_FILE` 已废弃并计划在 QGIS 5.0 移除。
184
+ 3. **日志走 stderr**:使用 `QGIS_SERVER_LOG_STDERR` 交给系统日志收集,`QGIS_SERVER_LOG_FILE` 已废弃。
191
185
  4. **并行渲染与线程**:高并发栅格出图时设置 `QGIS_SERVER_PARALLEL_RENDERING=true`,并用 `QGIS_SERVER_MAX_THREADS` 控制 CPU 占用。
192
186
  5. **项目缓存**:多项目场景调大 `QGIS_SERVER_PROJECT_CACHE_SIZE`,减少重复加载开销。
193
187
  6. **容错**:允许部分图层缺失时设 `QGIS_SERVER_IGNORE_BAD_LAYERS=true`,避免整份项目不可用。
@@ -1,15 +1,10 @@
1
1
  ---
2
2
  name: shapely
3
3
  description: "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."
4
- tags:
5
- - python
6
- - geometry
7
- - geos
8
- - wkt
9
- - wkb
10
- - geojson
11
- - spatial
12
- - numpy
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "python, geometry, geos, wkt, wkb, geojson, spatial, numpy"
13
8
  ---
14
9
 
15
10
  > **项目地址:** <https://github.com/shapely/shapely>
@@ -18,7 +13,9 @@ tags:
18
13
  >
19
14
  > **PyPI:** <https://pypi.org/project/shapely/>
20
15
  >
21
- > **包管理器:** `shapely`(最新 2.2.0,截至 2026-10,PyPI)
16
+ > **最新版本:** 2.2.0(截至 2026-11,[PyPI](https://pypi.org/project/shapely/);[GitHub Release](https://github.com/shapely/shapely/releases))
17
+ >
18
+ > **版本判定:** 上游 main 分支已打 `2.3.0.dev0` 开发版标签,属于未发布开发版,PyPI 稳定版仍是 2.2.0,本文按 2.2.0 写
22
19
  >
23
20
  > **许可证:** BSD-3-Clause
24
21
 
@@ -34,8 +31,9 @@ Shapely 是 Python 计算几何的核心库,基于 GEOS(Geometry Engine - Op
34
31
  - **空间索引**:STRtree,加速批量空间查询
35
32
  - **格式读写**:WKT、WKB、GeoJSON
36
33
  - **双重 API**:函数式(向量化,支持 NumPy 广播)+ OOP(标量便捷)
34
+ - **2.2 新增**:`minimum_width`、`get_segments`、`transform_coordseq`、`split`、`coverage_clean`;标量属性/方法的调用开销大幅下降(`p.x` 从 2-3 微秒降到约 50-100 纳秒)
37
35
 
38
- **环境要求:** Python 3.11+(Shapely 2.2 起;2.1 为 3.10+),NumPy >= 1.26,GEOS >= 3.10。PyPI 二进制 wheel 内含 GEOS 3.14。
36
+ **环境要求:** Python 3.11+(Shapely 2.2 起;2.1 为 3.10+),NumPy >= 1.26,GEOS >= 3.10。PyPI 二进制 wheel 内含 GEOS 3.14.1(2.2.0 起;2.1.2 的 wheel 是 3.13.1),Windows ARM64 wheel 自 2.2.0 起提供。
39
37
 
40
38
  ---
41
39
 
@@ -178,6 +176,18 @@ geom = shape({"type": "Point", "coordinates": [0, 0]})
178
176
  d = mapping(geom) # {"type": "Point", "coordinates": (0.0, 0.0)}
179
177
  ```
180
178
 
179
+ 常用 2.2 新增函数:
180
+
181
+ ```python
182
+ import shapely
183
+
184
+ shapely.minimum_width(polygon) # → LineString,最小宽度(最小直径)那条线段
185
+ shapely.get_segments(line) # → 每个 Linestring/LinearRing 拆成成对相邻顶点线段
186
+ shapely.transform_coordseq(geom, fn) # 按坐标序列做变换,性能优于已弃用的 shapely.ops.transform
187
+ shapely.split(geom, splitter) # 顶层 split(GEOS >= 3.15 用原生实现,否则回退 shapely.ops.split)
188
+ shapely.coverage_clean(geoms) # 清理多边形覆盖(缝隙/重叠),需 GEOS >= 3.14
189
+ ```
190
+
181
191
  > 构造操作、空间谓词、集合运算、测量、空间索引、仿射与坐标变换及线性参考的完整 API 见 [reference/operations-reference.md](reference/operations-reference.md)
182
192
 
183
193
  ## 有效性校验
@@ -193,11 +203,13 @@ shapely.make_valid(geom, method="linework") # or "structure"
193
203
  为同一几何的重复谓词判断缓存空间索引。
194
204
 
195
205
  ```python
196
- shapely.prepare(geom) # in-place, returns True if newly prepared
197
- shapely.destroy_prepared(geom) # free cache
206
+ shapely.prepare(geom) # in-place, returns True if newly prepared, False if already prepared
207
+ shapely.destroy_prepared(geom) # free cache, returns whether something was destroyed
198
208
  shapely.is_prepared(geom)
199
209
  ```
200
210
 
211
+ 2.2 起 `relate()` / `relate_pattern()` 也能利用已预处理的左输入几何,对同一几何反复做谓词判断时先 `prepare()` 更快。
212
+
201
213
  ## 缺失值
202
214
 
203
215
  `None` 表示缺失几何,各函数行为保持一致:
@@ -343,6 +355,9 @@ left_idx, right_idx = tree.query(left_geoms, predicate="intersects")
343
355
  | WKB 序列化丢失 LinearRing | WKB 规范不支持 LinearRing,会自动转为 LineString |
344
356
  | `to_geojson` 丢失 Z 坐标 | GeoJSON 标准不支持 Z,改用 WKB 或自定义序列化 |
345
357
  | `shapely.ops.transform` 弃用警告 | 2.2 起弃用,改用 `shapely.transform` 或 `shapely.transform_coordseq` |
358
+ | `AttributeError: module 'shapely' has no attribute 'minimum_width'` / `get_segments` | 装的是 2.2 之前的版本,这两个函数 2.2.0 才加入顶层命名空间 | `python -c "import shapely; print(shapely.__version__)"` 确认 >= 2.2.0 |
359
+ | `UnsupportedGEOSVersionError` 调 `coverage_clean` / `coverage_simplify` | 底层 GEOS 太旧(`coverage_clean` 需 GEOS >= 3.14、coverage 系列多数需 >= 3.12) | `shapely.geos_version` 核对;升级 shapely wheel(自带 GEOS 3.14.1)而不是只升级系统 GEOS |
360
+ | `multithreading_enabled` 装饰器告警 | 2.2 起弃用且不再内部使用,线程安全需自行保证不并发改同一批几何 | 去掉装饰器;多线程只读同一不可变几何数组时用 `shapely` 函数即可,需写时按线程切分数组 |
346
361
 
347
362
  ---
348
363
 
@@ -350,7 +365,7 @@ left_idx, right_idx = tree.query(left_geoms, predicate="intersects")
350
365
 
351
366
  - **本技能的组织**:主文件给高频用法,完整参数表与高级示例在 `reference/operations-reference.md`,需要时再展开;示例工程与生成的数据写到工作目录,不要改动技能目录本身。
352
367
  - **执行环境**:命令在终端 / shell 中执行(Windows 用 PowerShell);`python` 不一定是 QGIS/GDAL 自带环境,先 `python -c "import sys; print(sys.executable, sys.version)"`。
353
- - **先探测版本**:`python -c "import shapely; print(shapely.__version__, shapely.geos_version)"`;本技能按 2.2.0 编写,PyPI wheel 内含 GEOS 3.14。GEOS 低版本请按第 11 条降级(如 `coverage_clean` 需 3.14、`shapely.split` 需 3.15)。
368
+ - **先探测版本**:`python -c "import shapely; print(shapely.__version__, shapely.geos_version)"`;本技能按 2.2.0 编写,PyPI wheel 内含 GEOS 3.14.1。GEOS 低版本请按第 11 条降级(如 `coverage_clean` 需 3.14、`shapely.split` 需 3.15,低版本自动回退 `shapely.ops.split`)。
354
369
  - **验证产物(必做)**:`print(shapely.is_valid(g), shapely.is_valid_reason(g))` 报无效原因;面积/长度做量级断言;序列化回读 `shapely.from_wkt(shapely.to_wkt(g, rounding_precision=-1)).equals(g)`,改过几何后再核对一次 `geom_type` 与 `get_num_geometries()`。
355
370
  - **报错先查有效性**:`TopologyException: side location conflict` 基本都是输入几何自相交,先 `shapely.make_valid(g)`(可指定 `method="structure"`)再算,不要直接加 `buffer(0)`。
356
371
  - **性能与内存**:批量操作走向量化函数(`shapely.union_all`、`shapely.buffer(geoms, r)`),别逐条 OOP 循环;十万级以上几何先 `STRtree(geoms)` 过滤,再对小集合做精确谓词。
@@ -1,5 +1,18 @@
1
1
  # Shapely Operations API Reference
2
2
 
3
+ ## Contents
4
+
5
+ - Constructive Operations
6
+ - Spatial Predicates
7
+ - Set-Theoretic Operations
8
+ - Measurements
9
+ - STRtree Spatial Index
10
+ - Geometry Accessors
11
+ - Affine Transforms
12
+ - Coordinate Transforms
13
+ - Linear Referencing
14
+ - Coordinate Extraction & Segments (2.2)
15
+
3
16
  Constructive operations, predicates, set operations, measurements, indexing and coordinate operations split from SKILL.md.
4
17
 
5
18
  ---
@@ -197,3 +210,32 @@ shapely.shortest_line(a, b)
197
210
  shapely.get_segments(geom) # 提取 LineString/LinearRing 的逐段线段(2.2 新增)
198
211
  ```
199
212
 
213
+ ## Coordinate Extraction & Segments (2.2)
214
+
215
+ Added in Shapely 2.2.0.
216
+
217
+ | Function | Description |
218
+ |----------|-------------|
219
+ | `get_segments(geometry, include_z=False, return_index=False)` | Split each LineString/LinearRing into individual pairwise-vertex segments (returns ndarray of LINESTRINGs). Multi\* geometries are not supported. |
220
+ | `minimum_width(geometry)` | Minimum width (minimum diameter) as a LineString; degenerate inputs (Point/LineString) return a zero-length LineString. |
221
+ | `transform_coordseq(geometry, function)` | Apply a function per coordinate sequence (faster than the deprecated `shapely.ops.transform`). |
222
+ | `split(geometry, splitter)` | Split a geometry by another one (uses GEOS >= 3.15 when available, otherwise falls back to `shapely.ops.split`). Splitting a (Multi)Polygon by another (Multi)Polygon uses its boundary. |
223
+ | `coverage_clean(geometries, gap_width=0.0, snapping_distance=-1, merge_strategy="longest_border")` | Clean a polygonal coverage, closing gaps/overlaps (requires GEOS >= 3.14). |
224
+
225
+ ```python
226
+ import shapely
227
+ from shapely import LineString, Polygon
228
+
229
+ shapely.get_segments(LineString([(0, 0), (1, 1), (2, 2)]))
230
+ # array([<LINESTRING (0 0, 1 1)>, <LINESTRING (1 1, 2 2)>], dtype=object)
231
+
232
+ shapely.minimum_width(Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]))
233
+ # <LINESTRING (0 0, 1 0)>
234
+
235
+ shapely.split(LineString([(0, 0), (2, 0)]), shapely.Point(1, 0))
236
+ # GEOMETRYCOLLECTION (LINESTRING (0 0, 1 0), LINESTRING (1 0, 2 0))
237
+ ```
238
+
239
+ ### prepare()/relate() interplay
240
+
241
+ Since 2.2, `relate()` and `relate_pattern()` accept prepared geometries on the left input and then use a faster implementation. `prepare()` and `destroy_prepared()` return whether they changed anything.
@@ -1,16 +1,10 @@
1
1
  ---
2
2
  name: sharpmap
3
3
  description: "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."
4
- tags:
5
- - dotnet
6
- - csharp
7
- - 2d
8
- - map
9
- - rendering
10
- - wms
11
- - shapefile
12
- - postgis
13
- - winforms
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "dotnet, csharp, 2d, map, rendering, wms, shapefile, postgis, winforms"
14
8
  ---
15
9
 
16
10
  > **项目地址:** <https://github.com/SharpMap/SharpMap>
@@ -19,7 +13,7 @@ tags:
19
13
  >
20
14
  > **NuGet:** `SharpMap`、`SharpMap.UI`、`SharpMap.Extensions`、`SharpMap.Web`、`SharpMap.Layers.BruTile`
21
15
  >
22
- > **最新版本:** 1.2.0(截至 2026-10,NuGet;发布于 2021-03,仓库未归档但维护低频)
16
+ > **最新版本:** 1.2.0(截至 2026-11,[NuGet `SharpMap`](https://www.nuget.org/packages/SharpMap);发布于 2021-03,仓库未归档但维护低频)
23
17
  >
24
18
  > **许可证:** LGPL-2.1-or-later
25
19
 
@@ -1,24 +1,17 @@
1
1
  ---
2
2
  name: spatialite
3
3
  description: "Use when adding spatial SQL to a single-file SQLite database with SpatiaLite — mod_spatialite loading, InitSpatialMetaData, AddGeometryColumn, CreateSpatialIndex/MbrWithin, ST_Transform and GEOS predicates, spatialite_tool or ogr2ogr import of Shapefile, and GPKG fallback; also for 'no such module: mod_spatialite', 'no such function: InitSpatialMetaData', and 'the SPATIALITE_SECURITY environment variable' errors. libspatialite 5.1.0."
4
- tags:
5
- - spatialite
6
- - sqlite
7
- - sql
8
- - gis
9
- - spatial
10
- - geospatial
11
- - python
12
- - vector
13
- - gpkg
14
- - command-line
4
+ license: MIT
5
+ metadata:
6
+ category: gis
7
+ tags: "spatialite, sqlite, sql, gis, spatial, geospatial, python, vector, gpkg, command-line"
15
8
  ---
16
9
 
17
10
  > **项目地址:** <https://www.gaia-gis.it/fossil/libspatialite/index>
18
11
  >
19
12
  > **官方文档:** <https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html>
20
13
  >
21
- > **当前版本:** libspatialite 5.1.0(2023-08-04);spatialite-tools 5.1.0a(2023-08-13),截至 2026-10 仍为最新
14
+ > **最新版本:** libspatialite 5.1.0(2023-08-04,[源码目录](https://www.gaia-gis.it/gaia-sins/libspatialite-sources/));spatialite-tools 5.1.0a(2023-08-13,[源码目录](https://www.gaia-gis.it/gaia-sins/spatialite-tools-sources/)),截至 2026-11 仍为最新
22
15
  >
23
16
  > **安装包:** Debian/Ubuntu `libsqlite3-mod-spatialite` 5.1.0-3、`spatialite-bin` 5.1.0a-2;conda-forge `libspatialite` 5.1.0
24
17
  >
@@ -70,8 +63,8 @@ conda-forge 的 `libspatialite` 为 5.1.0,Windows / macOS / Linux 均有构建
70
63
  ### 方式四:源码编译
71
64
 
72
65
  ```bash
73
- curl -LO https://www.gaia-gis.it/gaia-sins/libspatialite-5.1.0-RC0.tar.gz
74
- tar xzf libspatialite-5.1.0-RC0.tar.gz
66
+ curl -LO https://www.gaia-gis.it/gaia-sins/libspatialite-sources/libspatialite-5.1.0.tar.gz
67
+ tar xzf libspatialite-5.1.0.tar.gz
75
68
  cd libspatialite-5.1.0
76
69
  ./configure --disable-rttopo # 按需启用 GEOS/PROJ/RTTOPO 等依赖
77
70
  make -j"$(nproc)"
@@ -106,8 +99,14 @@ python -c "import sqlite3; c=sqlite3.connect(':memory:'); c.enable_load_extensio
106
99
  spatialite mydb.sqlite
107
100
  spatialite> .load mod_spatialite
108
101
 
109
- # CLI:一次性执行(把扩展加载与 SQL 放在同一次调用里)
110
- spatialite mydb.sqlite -cmd ".load mod_spatialite" "SELECT spatialite_version();"
102
+ # CLI:一次性执行(选项须放在数据库文件之前,与 sqlite3 CLI 的 [OPTIONS] FILENAME [SQL] 顺序一致)
103
+ spatialite -cmd ".load mod_spatialite" mydb.sqlite "SELECT spatialite_version();"
104
+
105
+ # CLI:更稳妥的写法是用 heredoc 把 dot-command 与 SQL 一起从 stdin 送入
106
+ spatialite mydb.sqlite <<'EOF'
107
+ .load mod_spatialite
108
+ SELECT spatialite_version();
109
+ EOF
111
110
  ```
112
111
 
113
112
  ```python