xurc
xurc

Reputation: 99

HERE API: Toll cost is not optimized

I'm exploring HERE API in order to evaluate usefulness to our application. My interest is focused on estimated truck transport cost (toll, vehicle, driver). I'm facing with a problem in generating optimized route between 2 points: from 50.893017,20.615645 to 52.055324,21.010707. Driver cost set to 10, vehicle cost set to 1. And when I'm using https://fleet.ls.hereapi.com/2/calculateroute.json I get the distance in total 211km with 260.17 PLN cost (including 0 toll cost) When I'm using https://tce.cit.api.here.com/2/calculateroute.json I get distance 159km with 221.28 PLN (including 38.55 PLN toll cost). As you can see first API didn't returned cost optimized route. Moreover it looks like the first API is trying to omit toll gates, while this better than go around. Am I missing something? Why there is so much difference? Parameters for both queries looks similar.

First api parameters (excluding api keys):

jsonAttributes:41
waypoint0:50.893017,20.615645
waypoint1:52.055324,21.010707
detail:1
routelegattributes:li
routeattributes:gr
maneuverattributes:none
linkattributes:none,rt,fl
legattributes:none,li,sm
currency:PLN
departure:
tollVehicleType:3
trailerType:0
vehicleNumberAxles:2
trailerNumberAxles:0
hybrid:0
emissionType:3
fuelType:petrol
trailerHeight:0
vehicleWeight:40t
disabledEquipped:0
hov:0
passengersCount:2
tiresCount:4
commercial:0
heightAbove1stAxle:1m
width:1.8
length:4.41
mode:fastest;truck;traffic:disabled
alternatives:2
driver_cost:10
vehicle_cost:1

Second api parameters (excluding api keys):

jsonAttributes:41
waypoint0:50.893017,20.615645
waypoint1:52.055324,21.010707
detail:1
routelegattributes:li
routeattributes:gr
maneuverattributes:none
linkattributes:none,rt,fl
legattributes:none,li,sm
currency:PLN
departure:
tollVehicleType:3
trailerType:0
vehicleNumberAxles:2
trailerNumberAxles:0
hybrid:0
emissionType:3
fuelType:petrol
trailerHeight:0
vehicleWeight:40t
disabledEquipped:0
hov:0
passengersCount:2
tiresCount:4
commercial:0
heightAbove1stAxle:1m
width:1.8
length:4.41
mode:fastest;truck;traffic:disabled
alternatives:2
driver_cost:10
vehicle_cost:1

Upvotes: 0

Views: 227

Answers (1)

user3505695
user3505695

Reputation:

Please don't use in URL request nor the domain name tce.cit.api.here.com nor tce.api.here.com or some old parameter names also for fleet.ls.hereapi.com .

This tce.api.here.com is legacy and will be sometimes wrong calculate a toll.

Read please this documentation for tollPass parameter:

Comma separated list of owned passes: Senior_Pass, transponder, Annual, Nr_of_Days, Nr_of_Months, SunPass, E-Z Pass (last 2 are examples for real toll transponders). Allows traversal of 'transponder-only' toll booths and allows cost free traversal of certain toll sections.

Some toll booths and toll sections are allowed to use only by driver who has some toll pass e.g. tollPass=transponder otherwise a driver have to avoid these booths/toll sections to use more long way.

if you try to use e.g. tollPass=transponder parameter for request to fleet.ls.hereapi.com then you will see using toll section.

Upvotes: 1

Related Questions