Requesting a Route via a Third Coordinate
To calculate directions between two coordinates via a third coordinate, use the CalculateRouteRequest
service specifying the start (waypoint0
), middle point (waypoint1
) and destination (waypoint2
). Specifying waypoint1
as stopOver
instead of passThrough
means breaking the journey here, not just driving through. The string geo!
indicates that you are specifying each point using latitude and longitude. Note that you also have to specify an app_id
and app_code
(see Acquiring Credentials ), type of route calculation and whether to take traffic into account.
In the following example we request the fastest
route for a car
without taking traffic
conditions into account from the Westin Grand hotel at Unter den Linden in Berlin (52.516858379, 13.3884717) to the Staatsoper in Berlin (52.51733824, 13.394678415) via the Deutsche Guggenheim (52.51704771, 13.39131492).
https://route.hereapi.cn/routing/7.2/calculateroute.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&mode=fastest;car;traffic:disabled
&waypoint0=geo!52.516858379,13.3884717
&waypoint1=geo!stopOver!52.51704771,13.39131492
&waypoint2=geo!52.51733824,13.394678415