如何在 HERE API 中获取航点之间的距离



我想知道:

航点0 - 航点1 和航点

1 - 航点2 .

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

    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 来获取航点之间的距离。

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

最新更新