At my company, we calculate travel time for jobs based upon a website that gives the distance and time as if the driver was at the speed limit and there is no other traffic on the road. This is a mandatory requirement as the time of the day in which the calculation is done is rarely going to allow traffic patterns to align.
I am working to make the process faster by creating an internal website with a database containing all the relevant addresses. To do this I have written a web app using the HERE routing api in javascript; however, the travel time listed constantly changes despite my setting "'route_mode': 'shortest'" and "'traffic': 'disabled'".
Is there another setting that I have not found that would allow me to completely disregard traffic conditions in all my calculations?
If it helps, here is the function call:
async function get_distance_and_time(origin_coord,des_coord){
var dis;
var time;
var routingParameters = {
'route_mode': 'fastest',
'traffic': 'disabled',
'transportMode': 'car',
// The start point of the route:
'origin': origin_coord,
// The end point of the route:
'destination': des_coord,
// Include the route shape in the response
'return': 'summary'
};
var onResult = await function(result) {
if (result.routes.length) {
dis = result.routes[0].sections[0].summary.length;
time = result.routes[0].sections[0].summary.baseDuration;
console.log(result.routes[0].sections[0].summary);
}
}
var router = await platform.getRoutingService(null, 8);
await router.calculateRoute(routingParameters, onResult,
function(error) {
alert(error.message);
});
var return_data = [dis,time];
return return_data;