OSRM5.2 使用

环境

windows

配置环境

下载 Strawberry Perl for Windows

准备

1、下载pl
shp2osm.pl源码地址:https://svn.openstreetmap.org/applications/utils/import/shp2osm/shp2osm.pl
2、安装
cpan Geo::ShapeFile
在powershell执行

参考:
shp转osm格式——道路文件格式转换_程光CS的博客-CSDN博客

OSRM

1、下载osmd地图
2、编译OSRM
3、格式转换:../build/osrm-extract taiwan-latest.osm.pbf -p profiles/car.lua
4、编译未预加载格式:../build/osrm-contract taiwan-latest.osrm
5、启动服务:../build/osrm-routed taiwan-latest.osrm
测试

curl "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true"
curl "http://127.0.0.1:5000/route/v1/driving/26.38688,127.76486;26.40862,127.73390?steps=true"
curl "http://127.0.0.1:5000/route/v1/car/127.96536,26.47412;127.98047,26.47942?steps=true"

curl "http://127.0.0.1:5000/nearest/v1/driving/127.96536,26.47412?number=3&bearings=0,20"
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容