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

时间:2018-01-30 09:35:59

标签: here-api

我想知道之间的距离:

  

waypoint0 - waypoint1和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

提前谢谢。

1 个答案:

答案 0 :(得分:0)

您可以尝试航点序列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