【问题标题】:Turn-by-turn latitude and longitude on HERE Routing APIHERE Routing API 上的转弯纬度和经度
【发布时间】:2022-04-25 18:26:28
【问题描述】:

我想获得关于我从 HERE Routing API v8 获得的操作的每条指令的纬度和经度。我从 HERE Routing v7 获得了演习,但在 v8 上没有。我尝试了所有的返回值。

https://router.hereapi.com/v8/routes?apikey=APIKEY&origin=14.57755,121.04239&destination=14.57735,121.04274&return=polyline,summary,actions,instructions&spans=segmentId&transportMode=car

{
    "routes": [{
        "id": "bae447cc-a31f-48f7-83a7-2c73c34d492d",
        "sections": [{
            "id": "152087e3-7f61-451e-b764-e88583586f10",
            "type": "vehicle",
            "actions": [{
                    "action": "depart",
                    "duration": 10,
                    "length": 76,
                    "instruction": "Head toward Camiguin on Barangka Dr. Go for 76 m.",
                    "offset": 0
                },
                {
                    "action": "continue",
                    "duration": 22,
                    "length": 102,
                    "instruction": "Continue on 9 de Febrero toward Ortigas Ave/Shaw Blvd. Go for 102 m.",
                    "offset": 3
                },
                {
                    "action": "turn",
                    "duration": 12,
                    "length": 53,
                    "instruction": "Turn right onto Talumpong. Go for 53 m.",
                    "offset": 7,
                    "direction": "right",
                    "severity": "quite"
                },
                {
                    "action": "turn",
                    "duration": 29,
                    "length": 149,
                    "instruction": "Turn right onto Tabayog. Go for 149 m.",
                    "offset": 8,
                    "direction": "right",
                    "severity": "quite"
                },
                {
                    "action": "arrive",
                    "duration": 0,
                    "length": 0,
                    "instruction": "Arrive at Tabayog. Your destination is on the left.",
                    "offset": 13
                }
            ],
            "departure": {
                "time": "2022-02-03T18:59:50+08:00",
                "place": {
                    "type": "place",
                    "location": {
                        "lat": 14.5775706,
                        "lng": 121.0423584
                    },
                    "originalLocation": {
                        "lat": 14.5775499,
                        "lng": 121.04239
                    }
                }
            },
            "arrival": {
                "time": "2022-02-03T19:01:03+08:00",
                "place": {
                    "type": "place",
                    "location": {
                        "lat": 14.5773811,
                        "lng": 121.0426889
                    },
                    "originalLocation": {
                        "lat": 14.5773499,
                        "lng": 121.04274
                    }
                }
            },
            "summary": {
                "duration": 73,
                "length": 380,
                "baseDuration": 65
            },
            "polyline": "BGm635bs767mHiS0MsEkD8L0KgF0FsEoGgF4IoQsdvb8L3IvRnQze3IvHzK3I9ElD",
            "spans": [{
                    "offset": 0,
                    "topologySegmentId": "+here:cm:segment:46864687"
                },
                {
                    "offset": 3,
                    "topologySegmentId": "+here:cm:segment:47392105"
                },
                {
                    "offset": 7,
                    "topologySegmentId": "-here:cm:segment:26196228"
                },
                {
                    "offset": 8,
                    "topologySegmentId": "-here:cm:segment:23767715"
                },
                {
                    "offset": 10,
                    "topologySegmentId": "-here:cm:segment:21101714"
                }
            ],
            "language": "en-us",
            "transport": {
                "mode": "car"
            }
        }],
    }],
}

【问题讨论】:

    标签: here-api here-routing here-migration


    【解决方案1】:

    截至 2022 年 2 月 2 日,v7 中输出经纬度的位置参数不支持在 v8 中的机动属性下。 Source

    【讨论】:

      【解决方案2】:

      这在 V8 布线中是正确的,在机动中存在折线偏移。偏移量是折线的索引,V8 中的所有坐标都以这种方式工作。跨度,动作,它们已经偏移到作为坐标数组的路线形状中。示例:https://demo.routing.ext.here.com/#url=https://router.hereapi.com/v8/routes?apikey=DEFAULT_API_KEY&origin=52.551325,13.351349&destination=52.514255,13.34929&return=polyline,summary,actions,instructions&transportMode=car

      【讨论】:

        猜你喜欢
        • 2012-12-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-09-24
        • 2019-10-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多