gpt4 book ai didi

here-api - 这里路由 API V8 : How to get route with multiple pass through waypoints

转载 作者:行者123 更新时间:2023-12-05 06:17:38 25 4
gpt4 key购买 nike

在v7中,这是通过多个passthrough waypoints获取路线的方式:

https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=32.353514,-61.126775&waypoint1=passThrough!32.365181,-61.102086&waypoint2=32.360273,-61.091979&mode=fastest;pedestrian ...

在 v8 api 引用中,有一个“via”,似乎用于停靠航路点。

我试过了 https://router.hereapi.com/v8/routes?transportMode=pedestrian&return=summary,polyline,actions,instructions&origin=42.353514,-71.126775;42.365181,-71.102086&destination=42.360273,-71.091979&via=42.365181,-71.102086 ..

它在 route 生成 2 条腿(v8 定义中的“部分”)。我期待 1 条腿。

v8 developer guide页面提到 passThrough:

Waypoints may represent stopover points (that is, points where some time will be spent before retaking the route), or passthrough points that only influence the route's shape, but where no actual stop is carried out.

但我无法弄清楚如何在 v8 中查询具有多个通过点的路线。

有什么建议吗?

谢谢!!

最佳答案

我不确定在 V8 中返回 2 个部分而不是一个部分是否是一个问题。

关于穿越点,在API reference中有描述作为查询参数 viaWaypointOptions:

Supported waypoint options:

- stopDuration: desired duration for the stop, in seconds.

所以我假设所有请求都将不带选项 stopDurationvia 参数视为直通点。但是您总是可以添加 !stopDuration=0 以确保 100% 的安全。

此请求(带 stopDuration=0 或不带此选项)https://router.hereapi.com/v8/routes?transportMode=car&return=travelSummary,summary,polyline,actions&origin=42.353514,-71.126775&destination=42.360273,-71.091979&via=42.365181,-71.102086!stopDuration=0&apikey=YOUR_API_KEY

返回摘要:

"summary": {
"duration": 714,
"length": 3893,
"baseDuration": 637
}

这个请求带有 stopDuration=900 https://router.hereapi.com/v8/routes?transportMode=car&return=travelSummary,summary,polyline,actions&origin=42.353514,-71.126775&destination=42.360273,-71.091979&via=42.365181,-71.102086!stopDuration=900&apikey=YOUR_API_KEY

返回摘要:

"summary": {
"duration": 714,
"length": 3893,
"baseDuration": 1537
}

如您所见,baseDuration 已按要求增加了 900。

关于here-api - 这里路由 API V8 : How to get route with multiple pass through waypoints,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61513987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com