Request a Route via a Third Coordinate
To calculate directions between two coordinates via a third coordinate, use the CalculateRouteRequest
service and specify the start (waypoint0
), middle point (waypoint1
) and destination (waypoint2
). Specifying waypoint1
as stopOver
instead of passThrough
results in 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 apiKey
or app_id
and app_code
if you are using the app_id/app_code authentication (see the Identity & Access Management Developer Guide), type of route calculation and whether to take traffic into account.
The following example requests 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.ls.hereapi.com/routing/7.2/calculateroute.json
?apiKey={YOUR_API_KEY}
&mode=fastest;car;traffic:disabled
&waypoint0=geo!52.516858379,13.3884717
&waypoint1=geo!stopOver!52.51704771,13.39131492
&waypoint2=geo!52.51733824,13.394678415