0

I'd like to know the position in which the driver would need to rest with given waypoints.

I am calling GET https://fleet.ls.hereapi.com/2/calculateroute.json with the following params:

{
  mode: "fastest;car;traffic:enabled",
  waypoint0: "19.286769, -99.652773",
  waypoint1: "19.419185, -99.17755430000001",
  waypoint2: "19.41530,-99.17844",
  waypoint3: "31.29778, -110.93690",
  restTimes: "MEX", 
  maxSpeed: 110,
  departure: "2021-07-20T15:00:00.000Z"
}

This returns warnings with the info of rest times like this:

{
   "message": "Taking the short driver rest time after 18036 sec for 1800 sec at routeLinkSeqNum 1485",
   "code": 14,
   "routeLinkSeqNum": 1485
}

I would like to know how to use/read this info. I don't know what routeLinkSeqNum is and how to utilize it.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
pp__b
  • 123
  • 7

1 Answers1

0

Governments impose rules on how long a truck driver can drive before he needs to rest. Routing can consider these regulations w.r.t. short rests during a day and long (overnight) rests.

For example, in EU countries drivers have to rest after 4.5 hours of driving for at least 45 minutes, and must not exceed a total of 9 working hours per day before they have to rest for 11 hours.

Activate this feature in the router using the "&restTimes=local", in this case, it is the "MEX" in the request parameter. Routing will then consider each country's local regulations.

In the same parameter, you can specify whether the driver starts the route freshly or how long he is already driving / on duty since his last short or long rest period

routeLinkSeqNum is an index of the link array within a Leg. If you check the response, there will be response>route>[0]>leg[0]>[2]>link[1485].

So one route can have n-legs, 1 leg can have m-links

This will help you to plot the rest times. Here is an example shown in the tool: https://tcs.ext.here.com/examples/v3/fleet_telematics_api

enter image description here

  • Thanks for the response. Do you have this example in a repo so that I can review in detail how to render the rest times? – pp__b Aug 09 '21 at 22:04
  • The source code of this example is not available in the repo. The available JS examples in repo are listed here: https://github.com/heremaps/maps-api-for-javascript-examples –  Aug 25 '21 at 09:47