首页 > 解决方案 > 这里 api 显示具有相同起点和终点但通过附加航点的路线的交通时间更小

问题描述

在相同的到达/离开时间,为什么从 A 到 B 的 trafficTime(最快)比从 A 到 B 通过 C 的 trafficTime 长?

V7 请求:A 到 B:trafficTime = 4979 秒 https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=KEY&waypoint0=32.6289624435649%2C35.079885159610136&waypoint1=32.0155%2C34.7505&mode=fastest%3Bcar&combineChange =true&language=he&instructionformat=text&departure=2020-05-21T10:00:00.000Z

A 到 B 通过 C:trafficTime = 4936 秒 https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey=KEY&waypoint0=32.6289624435649%2C35.079885159610136&waypoint1=32.119485%2C34.938341&waypoint234=32.0155%2 7505&mode=fastest%3Bcar&combineChange=true&language=he&instructionformat=text&departure=2020-05-21T10:00:00.000Z

V8 也是 A 到 B:持续时间 = 3987 秒 https://router.hereapi.com/v8/routes?transportMode=car&return=travelSummary,summary,polyline,actions&origin=32.6289624435649,35.079885159610136&destination=32.0155,34.7505&apikey=KEY

A 到 B 通过 C:持续时间 = 3955 秒 https://router.hereapi.com/v8/routes?transportMode=car&return=travelSummary,summary,polyline,actions&origin=32.6289624435649,35.079885159610136&destination=32.0155,34.7505&via=32.11914853 ,. stopDuration=0&apikey=KEY

如果我要求显示几个替代方案(仅在没有“到达”参数的情况下可用)我会得到更快和更短的路线:V7 A 到 B 有替代方案:最快的 trafficTime = 4765 https://route.ls.hereapi.com/routing/7.2 /calculateroute.json?apiKey=KEY&waypoint0=32.6289624435649%2C35.079885159610136&waypoint1=32.0155%2C34.7505&mode=fastest%3Bcar&combineChange=true&language=he&instructionformat=text&departure=2020-05-200T10:00:00salternative=90&

标签: here-api

解决方案


在我们最后创建相同的场景,清楚地表明当我们指定 API 中给出的中间航点时,它们会发生重大的路线变化,这会减少旅行时间。请检查附件

在此处输入图像描述


推荐阅读