@dsh-gis/dsh-opengis-skill 0.1.0 → 0.1.2

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 (37) hide show
  1. package/.editorconfig +19 -0
  2. package/CHANGELOG.md +96 -0
  3. package/LICENSE +21 -21
  4. package/README.md +91 -30
  5. package/THIRD_PARTY_NOTICES.md +37 -10
  6. package/assets/gdal/reference/raster-tools.md +538 -538
  7. package/assets/gdal/reference/vector-tools.md +149 -149
  8. package/assets/gdal-api/reference/raster-api.md +424 -424
  9. package/assets/gdal-api/reference/vector-api.md +724 -724
  10. package/assets/geometry-api-net/reference/geometry-types.md +243 -243
  11. package/assets/geopandas/reference/core-api.md +221 -221
  12. package/assets/geotools/reference/raster-rendering.md +108 -108
  13. package/assets/geotools/reference/vector-io.md +149 -149
  14. package/assets/jts/reference/geometry-operations.md +303 -303
  15. package/assets/mapsui/SKILL.md +283 -283
  16. package/assets/opengis-all/reference/data-stages.md +608 -608
  17. package/assets/opengis-all/reference/workflow-cheatsheets.md +324 -324
  18. package/assets/opengis-utils-for-java/reference/common-tasks.md +384 -384
  19. package/assets/opengis-utils-for-net/reference/code-patterns.md +124 -124
  20. package/assets/opengis-utils-for-net/reference/util-classes.md +291 -291
  21. package/assets/pyqgis/reference/processing-rendering.md +292 -292
  22. package/assets/pyqgis/reference/vector-raster-layers.md +318 -318
  23. package/assets/qgis-process/SKILL.md +414 -414
  24. package/assets/qgis-process/reference/algorithm-cheatsheet.md +194 -194
  25. package/assets/shapely/reference/operations-reference.md +199 -199
  26. package/cordis.patch.yml +6 -3
  27. package/lib/catalog.d.ts +50 -0
  28. package/lib/catalog.js +238 -0
  29. package/lib/index.d.ts +47 -6
  30. package/lib/index.js +32 -44
  31. package/lib/markdown-links.d.ts +11 -0
  32. package/lib/markdown-links.js +103 -0
  33. package/lib/skill-file.js +104 -17
  34. package/locale/en.json +1 -1
  35. package/locale/zh.json +1 -1
  36. package/package.json +11 -5
  37. package/upstream.json +64 -2
@@ -1,149 +1,149 @@
1
- # GDAL Vector Tools Reference
2
-
3
- > 这是 [../SKILL.md](../SKILL.md) 的补充文件,收录 OGR 矢量工具(`ogrinfo`、`ogr2ogr`)的完整参数表与高级示例。
4
-
5
- ---
6
-
7
- ## ogrinfo — Vector Data Query
8
-
9
- **描述**: 列出和查询 OGR 支持的矢量数据源(Shapefile、GeoJSON、GeoPackage、PostGIS 等)。
10
-
11
- **基本用法**:
12
-
13
- ```bash
14
- # 列出所有图层
15
- ogrinfo mydata.shp
16
-
17
- # 获取特定图层信息
18
- ogrinfo mydata.shp layername -so
19
-
20
- # JSON 格式输出(GDAL 3.7+)
21
- ogrinfo -json mydata.shp
22
-
23
- # 显示所有要素及其属性
24
- ogrinfo -al -geom=YES mydata.shp
25
-
26
- # 限制显示的要素数量
27
- ogrinfo -al -limit 10 mydata.shp
28
-
29
- # 按属性过滤
30
- ogrinfo mydata.shp -where "AREA > 1000"
31
-
32
- # SQL 查询
33
- ogrinfo mydata.shp -sql "SELECT * FROM mydata WHERE population > 10000"
34
-
35
- # 空间范围过滤
36
- ogrinfo mydata.shp -spat -10 40 10 50
37
- ```
38
-
39
- **关键参数**:
40
-
41
- | 参数 | 说明 |
42
- |------|------|
43
- | `-json` | JSON 格式输出(GDAL 3.7+) |
44
- | `-al` | 列出所有图层及其要素 |
45
- | `-so` | 仅摘要(不显示单个要素) |
46
- | `-ro` | 只读模式 |
47
- | `-where <expr>` | SQL WHERE 表达式过滤 |
48
- | `-sql <statement>` | 执行 SQL 语句 |
49
- | `-spat <xmin> <ymin> <xmax> <ymax>` | 空间范围过滤 |
50
- | `-limit <n>` | 限制要素数量 |
51
- | `-geom=YES\|NO\|SUMMARY\|WKT` | 几何输出格式 |
52
- | `-fields=YES\|NO` | 是否输出字段值 |
53
-
54
- **示例**:
55
-
56
- ```bash
57
- # 查看 GeoPackage 所有图层及要素数
58
- ogrinfo -al -so buildings.gpkg
59
-
60
- # 获取 PostGIS 表的 JSON 信息
61
- ogrinfo -json "PG:dbname=mydb user=postgres" public.buildings
62
-
63
- # 查询人口超过 100 万的城市
64
- ogrinfo cities.shp -where "population > 1000000" -fields=YES
65
-
66
- # 导出为 GeoJSON 字符串(用于脚本)
67
- ogrinfo -json cities.shp | jq '.layers[0].features[0]'
68
- ```
69
-
70
- ---
71
-
72
- ## ogr2ogr — Vector Format Conversion and Processing
73
-
74
- **描述**: GDAL 最核心的矢量工具。可在各种格式间转换、重投影、过滤、合并矢量数据。
75
-
76
- **基本用法**:
77
-
78
- ```bash
79
- # 格式转换(Shapefile → GeoJSON)
80
- ogr2ogr output.geojson input.shp
81
-
82
- # 格式转换(Shapefile → GeoPackage)
83
- ogr2ogr -f GPKG output.gpkg input.shp
84
-
85
- # 重投影(WGS84 → Web Mercator)
86
- ogr2ogr -t_srs EPSG:3857 output.shp input.shp
87
-
88
- # 属性过滤
89
- ogr2ogr output.shp input.shp -where "area > 1000"
90
-
91
- # 选择特定字段
92
- ogr2ogr output.shp input.shp -select "id,name,geometry"
93
-
94
- # 创建空间索引
95
- ogr2ogr output.gpkg input.shp -of GPKG
96
-
97
- # 合并多个文件
98
- ogr2ogr -append output.shp input1.shp
99
- ogr2ogr -append output.shp input2.shp
100
-
101
- # 裁剪到矩形范围
102
- ogr2ogr output.shp input.shp -spat -10 40 10 50
103
-
104
- # 裁剪到多边形
105
- ogr2ogr -clipsrc clip_polygon.shp output.shp input.shp
106
-
107
- # SQL 转换(图层名通常为文件名去除扩展名)
108
- ogr2ogr -f GeoJSON output.geojson input.shp -sql "SELECT ST_Buffer(geometry, 100) as geom, name FROM input"
109
-
110
- # 添加字段
111
- ogr2ogr output.shp input.shp -sql "SELECT *, 'value' as new_field FROM input"
112
- ```
113
-
114
- **关键参数**:
115
-
116
- | 参数 | 说明 |
117
- |------|------|
118
- | `-f <format>` | 输出格式(GeoJSON, GPKG, KML, CSV 等) |
119
- | `-t_srs <EPSG>` | 目标坐标参考系 |
120
- | `-s_srs <EPSG>` | 源坐标参考系 |
121
- | `-where <expr>` | WHERE 表达式过滤 |
122
- | `-select <cols>` | 选择特定字段 |
123
- | `-append` | 追加到现有数据集 |
124
- | `-overwrite` | 覆盖现有输出文件 |
125
- | `-spat <xmin> <ymin> <xmax> <ymax>` | 矩形范围裁剪 |
126
- | `-clipsrc <file>` | 用多边形裁剪 |
127
- | `-sql <statement>` | SQL 查询 |
128
- | `-nln <name>` | 输出图层名 |
129
-
130
- **高级示例**:
131
-
132
- ```bash
133
- # 合并多个 Shapefile(同时重投影)
134
- for file in *.shp; do
135
- ogr2ogr -append -t_srs EPSG:4326 merged.shp "$file"
136
- done
137
-
138
- # 分割大文件(按行政区划)
139
- ogr2ogr filtered.shp input.shp -where "county='New York'"
140
-
141
- # 添加自增 ID 字段
142
- ogr2ogr output.shp input.shp -sql "SELECT *, FID as id FROM input"
143
-
144
- # 转换到 CSV(用于分析)
145
- ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_WKT
146
-
147
- # PostGIS 导入
148
- ogr2ogr -f PostgreSQL "PG:dbname=mydb user=postgres" input.shp -nln mytable
149
- ```
1
+ # GDAL Vector Tools Reference
2
+
3
+ > 这是 [../SKILL.md](../SKILL.md) 的补充文件,收录 OGR 矢量工具(`ogrinfo`、`ogr2ogr`)的完整参数表与高级示例。
4
+
5
+ ---
6
+
7
+ ## ogrinfo — Vector Data Query
8
+
9
+ **描述**: 列出和查询 OGR 支持的矢量数据源(Shapefile、GeoJSON、GeoPackage、PostGIS 等)。
10
+
11
+ **基本用法**:
12
+
13
+ ```bash
14
+ # 列出所有图层
15
+ ogrinfo mydata.shp
16
+
17
+ # 获取特定图层信息
18
+ ogrinfo mydata.shp layername -so
19
+
20
+ # JSON 格式输出(GDAL 3.7+)
21
+ ogrinfo -json mydata.shp
22
+
23
+ # 显示所有要素及其属性
24
+ ogrinfo -al -geom=YES mydata.shp
25
+
26
+ # 限制显示的要素数量
27
+ ogrinfo -al -limit 10 mydata.shp
28
+
29
+ # 按属性过滤
30
+ ogrinfo mydata.shp -where "AREA > 1000"
31
+
32
+ # SQL 查询
33
+ ogrinfo mydata.shp -sql "SELECT * FROM mydata WHERE population > 10000"
34
+
35
+ # 空间范围过滤
36
+ ogrinfo mydata.shp -spat -10 40 10 50
37
+ ```
38
+
39
+ **关键参数**:
40
+
41
+ | 参数 | 说明 |
42
+ |------|------|
43
+ | `-json` | JSON 格式输出(GDAL 3.7+) |
44
+ | `-al` | 列出所有图层及其要素 |
45
+ | `-so` | 仅摘要(不显示单个要素) |
46
+ | `-ro` | 只读模式 |
47
+ | `-where <expr>` | SQL WHERE 表达式过滤 |
48
+ | `-sql <statement>` | 执行 SQL 语句 |
49
+ | `-spat <xmin> <ymin> <xmax> <ymax>` | 空间范围过滤 |
50
+ | `-limit <n>` | 限制要素数量 |
51
+ | `-geom=YES\|NO\|SUMMARY\|WKT` | 几何输出格式 |
52
+ | `-fields=YES\|NO` | 是否输出字段值 |
53
+
54
+ **示例**:
55
+
56
+ ```bash
57
+ # 查看 GeoPackage 所有图层及要素数
58
+ ogrinfo -al -so buildings.gpkg
59
+
60
+ # 获取 PostGIS 表的 JSON 信息
61
+ ogrinfo -json "PG:dbname=mydb user=postgres" public.buildings
62
+
63
+ # 查询人口超过 100 万的城市
64
+ ogrinfo cities.shp -where "population > 1000000" -fields=YES
65
+
66
+ # 导出为 GeoJSON 字符串(用于脚本)
67
+ ogrinfo -json cities.shp | jq '.layers[0].features[0]'
68
+ ```
69
+
70
+ ---
71
+
72
+ ## ogr2ogr — Vector Format Conversion and Processing
73
+
74
+ **描述**: GDAL 最核心的矢量工具。可在各种格式间转换、重投影、过滤、合并矢量数据。
75
+
76
+ **基本用法**:
77
+
78
+ ```bash
79
+ # 格式转换(Shapefile → GeoJSON)
80
+ ogr2ogr output.geojson input.shp
81
+
82
+ # 格式转换(Shapefile → GeoPackage)
83
+ ogr2ogr -f GPKG output.gpkg input.shp
84
+
85
+ # 重投影(WGS84 → Web Mercator)
86
+ ogr2ogr -t_srs EPSG:3857 output.shp input.shp
87
+
88
+ # 属性过滤
89
+ ogr2ogr output.shp input.shp -where "area > 1000"
90
+
91
+ # 选择特定字段
92
+ ogr2ogr output.shp input.shp -select "id,name,geometry"
93
+
94
+ # 创建空间索引
95
+ ogr2ogr output.gpkg input.shp -of GPKG
96
+
97
+ # 合并多个文件
98
+ ogr2ogr -append output.shp input1.shp
99
+ ogr2ogr -append output.shp input2.shp
100
+
101
+ # 裁剪到矩形范围
102
+ ogr2ogr output.shp input.shp -spat -10 40 10 50
103
+
104
+ # 裁剪到多边形
105
+ ogr2ogr -clipsrc clip_polygon.shp output.shp input.shp
106
+
107
+ # SQL 转换(图层名通常为文件名去除扩展名)
108
+ ogr2ogr -f GeoJSON output.geojson input.shp -sql "SELECT ST_Buffer(geometry, 100) as geom, name FROM input"
109
+
110
+ # 添加字段
111
+ ogr2ogr output.shp input.shp -sql "SELECT *, 'value' as new_field FROM input"
112
+ ```
113
+
114
+ **关键参数**:
115
+
116
+ | 参数 | 说明 |
117
+ |------|------|
118
+ | `-f <format>` | 输出格式(GeoJSON, GPKG, KML, CSV 等) |
119
+ | `-t_srs <EPSG>` | 目标坐标参考系 |
120
+ | `-s_srs <EPSG>` | 源坐标参考系 |
121
+ | `-where <expr>` | WHERE 表达式过滤 |
122
+ | `-select <cols>` | 选择特定字段 |
123
+ | `-append` | 追加到现有数据集 |
124
+ | `-overwrite` | 覆盖现有输出文件 |
125
+ | `-spat <xmin> <ymin> <xmax> <ymax>` | 矩形范围裁剪 |
126
+ | `-clipsrc <file>` | 用多边形裁剪 |
127
+ | `-sql <statement>` | SQL 查询 |
128
+ | `-nln <name>` | 输出图层名 |
129
+
130
+ **高级示例**:
131
+
132
+ ```bash
133
+ # 合并多个 Shapefile(同时重投影)
134
+ for file in *.shp; do
135
+ ogr2ogr -append -t_srs EPSG:4326 merged.shp "$file"
136
+ done
137
+
138
+ # 分割大文件(按行政区划)
139
+ ogr2ogr filtered.shp input.shp -where "county='New York'"
140
+
141
+ # 添加自增 ID 字段
142
+ ogr2ogr output.shp input.shp -sql "SELECT *, FID as id FROM input"
143
+
144
+ # 转换到 CSV(用于分析)
145
+ ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_WKT
146
+
147
+ # PostGIS 导入
148
+ ogr2ogr -f PostgreSQL "PG:dbname=mydb user=postgres" input.shp -nln mytable
149
+ ```