osrm - 如何使用 OSRM 的匹配服务

标签 osrm

如标题中所述:如何使用匹配调用?
我试过

http://router.project-osrm.org/match/v1/driving/8.610048,46.99917;8.530232,47.051?overview=full&radiuses=49;49

我不确定,是否是radiuses的列表正确给出。
我不能让它工作。我也试过 [49;49]{49;49}该命令适用于 route :
http://router.project-osrm.org/route/v1/driving/8.610048,46.99917;8.530232,47.051?overview=full

有关背景,请参阅 here

编辑 :如果你看例子here ,看来,timestamps不需要 /match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}

最佳答案

来自 docs :

Large jumps in the timestamps (> 60s) or improbable transitions lead to trace splits if a complete matching could not be found.



我认为这就是您的请求的问题。给定的两个点相距超过 60 秒,OSRM 无法成功匹配它们。 radiuses被正确指定。

以下查询对我有用:
http://router.project-osrm.org/match/v1/driving/8.610048,46.99917;8.620048,46.99917?overview=full&radiuses=49;49

这将返回:
{"tracepoints":[{"location":[8.610971,46.998963],"name":"Alte Kantonstrasse","hint":"GKUFgJEhBwAAAAAAHQAAAAAAAAC5AAAAAAAAAB0AAAAAAAAAuQAAAPsCAACbZIMAsyXNAgBhgwCCJs0CAAAPABki8hY=","matchings_index":0,"waypoint_index":0,"alternatives_count":0},{"location":[8.620295,46.999681],"name":"Schönenbuchstrasse","hint":"nIEFAJ7IFIA3AAAAZAAAAAAAAADYAAAANwAAAGQAAAAAAAAA2AAAAPsCAAAHiYMAgSjNAhCIgwCCJs0CAAAPABki8hY=","matchings_index":0,"waypoint_index":1,"alternatives_count":5}],"matchings":[{"distance":922.3,"duration":114.1,"weight":114.1,"weight_name":"routability","geometry":"onz}Gqyps@Wg@S_@aCaFMUYo@c@w@OKOCWmAWs@aBiDsAsCMYH[HY\\_@h@ObBW^w@BQAUKu@ASF[ZaABOFYpAyIf@mD","confidence":0.000982,"legs":[{"distance":922.3,"duration":114.1,"weight":114.1,"summary":"","steps":[]}]}],"code":"Ok"}

所以给定的两个输入点 8.610048,46.999178.620048,46.99917匹配到 8.610971,46.9989638.620295,46.999681 .

所以据我所知,如果你想实现类似 that 的东西,您需要在途中为 OSRM 提供更多相隔小于 60 秒的输入点。

另见 here有关 route 之间差异的解释和 match服务。

关于osrm - 如何使用 OSRM 的匹配服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50698754/

相关文章:

c++ - 双线性插值 - OSRM Rastersource

javascript - 获取 OSRM 路由的 JSON

api - 在 OSRM 中根据路线请求更改车辆配置文件?

openstreetmap - 使用 OSRM 在 openstreetmaps 上获取路线

r - 如何在R中使用OSRM绘制多个等时线多边形?

r - 车辆从 A 到 B,然后沿着路线从 B 到 A 的动画(在 B 有一些等待时间)

docker - "[error] Input file not found!"Docker OSRM

docker - 无法 docker 运行