路线规划graphhopper

下载安装包

下载graphhopper

官网地址 https://graphhopper.com

github 地址 https://github.com/graphhopper/graphhopper,可以下载自己编译;

直接下载releases版本 https://github.com/graphhopper/graphhopper/releases , 下载jar包,和 config-example.yml 文件

下载路网数据

http://download.geofabrik.de/asia.html

选择 asia china 下载pbf文件

修改配置文件

1
2
3
# 修改启动的ip
$ vi config-example.yml
bind_host: 172.16.100.92

启动服务

1
$ java -Xmx2g -Xms2g -Ddw.graphhopper.datareader.file=china-latest.osm.pbf -jar graphhopper-web-5.0.jar server config-example.yml

调用服务规划路线

http://172.16.100.92:8989/route?point=36.441659,117.100956&point=39.733715,116.181885&type=json&locale=zh-CN&vehicle=car&weighting=fastest&points_encoded=false

官网demo

https://graphhopper.com/maps/?point=%E5%8D%97%E9%83%A8%E5%B1%B1%E5%8C%BA%2C%20250100%2C%20Jinan%20City%2C%20China&point=%E4%BA%AC%E6%8A%95%E4%B8%87%E7%A7%91%E6%96%B0%E9%87%8C%E7%A8%8B-%E5%8C%97%E5%8C%BA%2C%20Fangshan%20District%2C%20China&locale=zh-CN&elevation=true&profile=car&use_miles=false&selected_detail=Elevation&layer=Omniscale

提示信息sign

sign description
-98 an U-turn without the knowledge if it is a right or left U-turn
-8 a left U-turn
-7 keep left
-6 not yet used: leave roundabout
-3 turn sharp left
-2 turn left
-1 turn slight left
0 continue on street
1 turn slight right
2 turn right
3 turn sharp right
4 the finish instruction before the last point
5 the instruction before a via point
6 the instruction before entering a roundabout
7 keep right
8 a right U-turn
* For future compatibility it is important that all clients are able to handle also unknown instruction sign numbers

路线规划graphhopper
https://zhaops-hub.github.io/2022/04/20/cesium/路线规划graphhopper/
作者
赵培胜
发布于
2022年4月20日
许可协议