环境
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"
网友评论