如何使用 graphhopper 为自行车道进行 gps 地图匹配

How to do a gps map-matching with graphhopper for a bicycle-track

我需要将自行车记录的 gps 轨迹与 openstreetmap 匹配。为此,我使用 graphhopper 的 map-matching 扩展。路由默认是car,但是有个参数vehicle=

我试过了 ./map-matching.sh action=import datasource=./map-data/*.osm.pbf vehicle=bike

出现错误

Exception in thread "main" java.lang.IllegalStateException: Encoding does not match:
Graphhopper config: bike|speedFactor=2.0|speedBits=4|turnCosts=false
Graph: car|speedFactor=5.0|speedBits=5|turnCosts=false, dir:./graph-cache/
        at com.graphhopper.storage.GraphHopperStorage.loadExisting(GraphHopperStorage.java:1410)
        at com.graphhopper.GraphHopper.load(GraphHopper.java:757)
        at com.graphhopper.GraphHopper.importOrLoad(GraphHopper.java:601)
        at com.graphhopper.matching.MapMatchingMain.start(MapMatchingMain.java:56)
        at com.graphhopper.matching.MapMatchingMain.main(MapMatchingMain.java:38)

这个错误是什么意思?对于汽车,它没有任何问题:

./map-matching.sh action=import datasource=./map-data/*.osm.pbf vehicle=car

2015-04-30 10:29:37,624 [main] INFO  com.graphhopper.GraphHopper - version 0.5|2015-04-22T18:00:26+0000 (4,12,3,2,2)
2015-04-30 10:29:37,641 [main] INFO  com.graphhopper.GraphHopper - graph GraphHopperStorage|car|RAM_STORE|2D|NoExt|4,12,3,2,2,
details:edges:1 024 914(32), nodes:833 438(10), name: /(3), geo:7 254 610(28),
bounds:5.95087757596845,10.511746492499407,45.81184228834157,47.811018254109136

我的系统

> mvn --version
Apache Maven 2.2.1 (rdebian-15)
Java version: 1.7.0_79
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: de_CH, platform encoding: UTF-8
OS name: "linux" version: "3.16.0-34-generic" arch: "amd64" Family: "unix"

在第一次导入时,GraphHopper 会为地图匹配组件创建文件夹 graph-cache。如果您更改车辆或区域以触发新的导入,则需要删除此文件夹。

请确保您使用的是“official repo”而不是我个人的叉子:)

请随时提供拉取请求以改进 documentation/readme。