【问题标题】:How to use OSRM's match service如何使用 OSRM 的匹配服务
【发布时间】:2018-11-14 20:40:53
【问题描述】:

如标题中所述:如何使用 match 调用?
我试过了

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}

【问题讨论】:

  • 我认为match 仅在您具有关联的时间戳时才有效。它用于将 GPS 跟踪与网络进行匹配,并找出您最合理的路径。
  • @Phylogenesis 好点,但是如果您查看解决方案建议 here 似乎这应该有效?

标签: osrm


【解决方案1】:

来自docs

如果无法找到完整的匹配,时间戳中的大跳跃 (> 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.999178.620048,46.99917 两个给定输入点与8.610971,46.9989638.620295,46.999681 匹配。

据我所知,如果你想实现类似that 的东西,你需要给 OSRM 提供更多的输入点,它们之间的间隔小于 60 秒。

另请参阅here,了解routematch 服务之间的区别。

【讨论】:

    猜你喜欢
    • 2020-12-04
    • 2017-09-09
    • 1970-01-01
    • 2018-10-29
    • 1970-01-01
    • 2022-10-06
    • 2018-10-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多