如何使用OSRM匹配服务

2024-04-09

如标题中所述:如何使用匹配调用?
I tried

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

我不确定该列表是否radiuses给出正确。 我无法让它发挥作用。我也尝试过[49;49] or {49;49}该命令适用于route:

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

背景请参见here https://stackoverflow.com/a/50697702/5784831

Edit: 如果你看一下这个例子here http://project-osrm.org/docs/v5.5.1/api/#match-service,itr 看来,timestamps不需要/match/v1/{profile}/{coordinates}?steps={true|false}&geometries={polyline|polyline6|geojson}&overview={simplified|full|false}&annotations={true|false}


来自docs http://project-osrm.org/docs/v5.5.1/api/#match-service:

如果无法找到完整的匹配,则时间戳中的大幅跳跃(> 60 秒)或不可能的转换会导致跟踪分裂。

我认为这就是你的要求的问题。两个给定点相距超过 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.99917 and 8.620048,46.99917匹配到8.610971,46.998963 and 8.620295,46.999681.

据我所知,如果你想实现类似的东西that https://github.com/Project-OSRM/osrm-backend/issues/3464,您需要为 OSRM 提供更多间隔小于 60 秒的输入点。

也可以看看here https://stackoverflow.com/questions/43383783/difference-between-osrm-route-and-match-service/43890717#43890717有关之间差异的解释route and match服务。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用OSRM匹配服务 的相关文章