The request below demonstrates truck routing including a ferry and uses a waypoint to guide the route calculation based on local knowledge.
Figure-1 shows the route calculated for a truck with the
fast routing mode between Helsinki and Rostock for two use cases. The one in red is the one presented when no other input is provided. This route gets the vehicle to its destination in the shortest time based on our general assumptions about ferries. However, if the user prefers to use the direct ferry line instead, they can set a passthrough waypoint(
via=53.929829,8.652357!passThrough=true) on the Helsinki-Travemünde ferry route as shown in
curl -X GET https://router.hereapi.com/v8/routes?origin=60.17202,24.91805&destination=54.07906,12.13216&via=59.80881,24.422038!passThrough=true&return=polyline,summary,actions,instructions&spans=notices&transportMode=truck&routingMode=fast
Using a passthrough waypoint that is near the port closest to the origin will give the best results.
For more information on truck routing and ferries, see these tutorials: