project-osrm最近的OpenStreetMap点id

问题描述 投票:0回答:2

我必须在OpenStreetMap中找到地理空间点的最近节点(id)

我可以使用官方演示api https://router.project-osrm.org/nearest/v1/foot/13.388860,52.517037

我有这个非常好的输出:

/ 20170831155106
// https://router.project-osrm.org/nearest/v1/foot/13.388860,52.517037

{
  "waypoints": [
    {
  "hint": "DB0KgLNSo4oUAAAAIAAAAAcAAAAAAAAACgAAABAAAAAEAAAAAAAAAK7aAAAATMwAqVghAzxMzACtWCEDAQAPAN1tFXI=",
  "distance": 4.085341,
  "location": [
    13.3888,
    52.517033
  ],
  "name": "Friedrichstraße"
}

],“代码”:“好的”}

但是没有给我最近的OSM节点ID,我不能使用“?annotations = true”,因为我收到了这条消息

https://router.project-osrm.org/nearest/v1/foot/13.388860,52.51703713.388860,52.517037?annotations=true

{'code': 'InvalidQuery',
 'message': 'Query string malformed close to position 37'}

感谢大家的帮助!

gis openstreetmap osrm
2个回答
0
投票

这个功能是currently being worked on。 PR看起来不错,但需要修复边缘。


0
投票

试试这样..

示例 - http://router.project-osrm.org/nearest/v1/driving/79.887810,7.005145?number=3&bearings=90,100

输出 -

{
    "waypoints": [
        {
            "nodes": [
                2264199819,
                2045820592
            ],
            "hint": "5c34iGPO-IgIAAAADgAAAAMAAAAAAAAAeOI0QY6li0FoZYRAAAAAAAgAAAAOAAAAAwAAAAAAAADxpQAAAEzMAKlYIQM8TMwArVghAwEA3wrB8JPr",
            "distance": 4.096695475190991,
            "name": "Friedrichstraße",
            "location": [
                13.3888,
                52.517033
            ]
        }
    ],
    "code": "Ok"
}
© www.soinside.com 2019 - 2024. All rights reserved.