Install
openclaw skills install @ruiduobao/geoskill-least-cost-pathopenclaw skills install @ruiduobao/geoskill-least-cost-pathUsing a cost raster, computes the minimum cumulative cost distance and backlinks from the source to the whole grid with Dijkstra (8-neighborhood, diagonal weighted by √2), then traces back from the target point to extract the least-cost path. Outputs a cost-distance raster and the path as GeoJSON.
pip install numpy rasterio scipy
python geoskill-least-cost-path.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-least-cost-path.py --bbox 121.0 31.0 122.0 32.0 --synthetic --output-dir ./out2 --quiet
python geoskill-least-cost-path.py --input <your data file> --output-dir ./out3
python geoskill-least-cost-path.py --bbox 116.39 39.90 116.40 39.91 --synthetic --output-dir ./out4 --quiet
| File | Format | Description |
|---|---|---|
cost_distance.tif | GeoTIFF/GeoJSON/JSON | Primary output |
least_cost_path.geojson | GeoTIFF/GeoJSON/JSON | Primary output |
output-manifest.json | JSON | Run manifest |
--synthetic mode reads no external data.MIT
基于成本栅格用 Dijkstra 计算从源点到全图的最小累积成本距离与回溯链接(8 邻域,对角线 √2 加权),再从目标点回溯提取最小成本路径。输出成本距离栅格与路径 GeoJSON。
pip install numpy rasterio scipy
python geoskill-least-cost-path.py --bbox 116.0 39.0 117.0 40.0 --synthetic --output-dir ./out
python geoskill-least-cost-path.py --bbox 121.0 31.0 122.0 32.0 --synthetic --output-dir ./out2 --quiet
python geoskill-least-cost-path.py --input <你的数据文件> --output-dir ./out3
python geoskill-least-cost-path.py --bbox 116.39 39.90 116.40 39.91 --synthetic --output-dir ./out4 --quiet
| 文件 | 格式 | 说明 |
|---|---|---|
cost_distance.tif | GeoTIFF/GeoJSON/JSON | 主产物 |
least_cost_path.geojson | GeoTIFF/GeoJSON/JSON | 主产物 |
output-manifest.json | JSON | 运行清单 |
--synthetic 模式不读取任何外部数据。MIT