使用SuperMap WebAssembly 进行几何分析,支持缓冲区、凸包、相交、合并、擦除、裁剪等 20+ 种几何操作
基于 SuperMap WebAssembly 的高性能几何分析工具。支持 20 余种几何分析操作,包括缓冲区分析、拓扑运算、距离计算等。
bash
安装后可以直接使用 wasi-geo 命令,否则需要使用 node bin/supermap-wasi-geo.js。
| 操作 | 说明 | 参数 |
|---|---|---|
| buffer | 缓冲区分析 | --input, --radius |
| convex-hull |
| 操作 | 说明 | 参数 |
|---|---|---|
| intersect | 相交分析 | --input1, --input2 |
| union |
| 操作 | 说明 | 参数 |
|---|---|---|
| is-left | 点是否在线左侧 | --point, --line-start, --line-end |
| is-right |
cmd
powershell
| 参数 | 说明 |
|---|---|
| --input <json> | GeoJSON 字符串输入 |
| --input-file <path> |
cmd
rem 点缓冲区
node bin\supermap-wasi-geo.js buffer --input {\type\:\Point\,\coordinates\:[120,30]} --radius 2 --pretty
rem 线缓冲区
node bin\supermap-wasi-geo.js buffer --input {\type\:\LineString\,\coordinates\:[[0,0],[10,0]]} --radius 0.5 --pretty
rem 多边形缓冲区
node bin\supermap-wasi-geo.js buffer --input {\type\:\Polygon\,\coordinates\:[[[0,0],[1,0],[1,1],[0,1],[0,0]]]} --radius 0.1 --pretty
cmd
rem 两点距离
node bin\supermap-wasi-geo.js distance --input1 {\type\:\Point\,\coordinates\:[0,0]} --input2 {\type\:\Point\,\coordinates\:[3,4]}
rem 输出: {type:Result,distance:5}
cmd
node bin\supermap-wasi-geo.js has-intersection --input1 {\type\:\Point\,\coordinates\:[0,0]} --input2 {\type\:\Point\,\coordinates\:[1,1]}
rem 输出: {type:Result,hasIntersection:false}
cmd
rem 判断点是否在线左侧
node bin\supermap-wasi-geo.js is-left --point [0,1] --line-start [0,0] --line-end [1,0]
rem 判断点是否在线段上
node bin\supermap-wasi-geo.js is-point-on-line --point [0.5,0] --line-start [0,0] --line-end [1,0]
rem 计算点到线段距离
node bin\supermap-wasi-geo.js distance-to-line --point [0,1] --line-start [0,0] --line-end [1,0]
cmd
rem 测地线距离(单位:米)
node bin\supermap-wasi-geo.js geodesic-distance --input {\type\:\LineString\,\coordinates\:[[0,0],[1,1]]}
rem 测地线面积(单位:平方米)
node bin\supermap-wasi-geo.js geodesic-area --input {\type\:\Polygon\,\coordinates\:[[[0,0],[1,0],[1,1],[0,1],[0,0]]]}
cmd
rem 从文件读取,输出到文件
node bin\supermap-wasi-geo.js buffer --input-file input.geojson --radius 2 --output buffer.geojson
rem 双几何操作
node bin\supermap-wasi-geo.js intersect --input1-file polygon1.geojson --input2-file polygon2.geojson --output intersect.geojson
powershell
cmd
cd e:\wasi_test
rem 显示帮助
node bin\supermap-wasi-geo.js --help
rem 测试缓冲区
node bin\supermap-wasi-geo.js buffer --input {\type\:\Point\,\coordinates\:[120,30]} --radius
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 supermap-wasi-geo-1776023777 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 supermap-wasi-geo-1776023777 技能
skillhub install supermap-wasi-geo-1776023777
文件大小: 614.29 KB | 发布时间: 2026-4-13 12:13