0

我必须在 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'}

感谢大家的帮助!

4

2 回答 2

0

此功能目前正在开发中。PR 看起来不错,但需要在边缘进行一些修复。

于 2017-09-03T11:27:20.067 回答
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"
}
于 2019-03-05T05:03:18.943 回答