如何在此处 API 中获取 waypoints 之间的距离

How to get distance between waypoints in HERE API

我想知道之间的距离:

waypoint0 - waypoint1 and waypoint1 - waypoint2 .

目前我正在使用以下请求:

    https://tce.cit.api.here.com/2/calculateroute.json?
    mode=fastest;truck;traffic:disabled&
    truckType=tractorTruck&
    maneuverAttributes=none&
    combineChange=true&
    routeAttributes=none,wp,sm,sh,no&
    linkAttributes=none&
    legAttributes=none&
    detail=1&
    alternatives=2&
    rollup=total,country&
    jsonattributes=41&
    waypoint0=geo!stopOver!53.55155000,9.99960000&
    waypoint1=geo!passThrough!45.97279231,4.73305852&
    waypoint2=geo!stopOver!41.15305000,-8.57573000

提前致谢。

您可以尝试航点序列 API 来获取 waypoints 之间的距离。

https://wse.ls.hereapi.com/2/findsequence.json
?start=Berlin-Main-Station;52.52282,13.37011
&destination1=East-Side-Gallery;52.50341,13.44429
&destination2=Olympiastadion;52.51293,13.24021
&end=HERE-Berlin-Campus;52.53066,13.38511
&mode=fastest;car
&apiKey={YOUR_API_KEY}

响应类似于 -

{
      "fromWaypoint": "waypoint0",
      "toWaypoint": "waypoint1",
      "distance": 7264,
      "time": 851,
      ...
    }

更多详细信息,请参阅文档-

https://developer.here.com/documentation/routing-waypoints/dev_guide/topics/quick-start-simple-car.html