Lin Kassem
Lin Kassem

Reputation: 55

Avoid toll roads only if possible in Here maps

I'm using HERE.com Routing API to get the route between 2 points. I used tollroad:-1 feature in the request. Which from my understanding will try to avoid toll roads and if it can't avoid toll roads it will return the route with toll roads.

For example if I try to calculate the route between 'Berlin, Germany' & 'Paris, France' I am getting this error:

{"issues":[{"message":"Router returned no route, error: 400 : {\"_type\":\"ns2:RoutingServiceErrorType\",\"type\":\"ApplicationError\",\"subtype\":\"NoRouteFound\",\"details\":\"Error is NGEO_ERROR_GRAPH_DISCONNECTED_CHECK_OPTIONS\",\"additionalData\":[{\"key\":\"error_code\",\"value\":\"NGEO_ERROR_GRAPH_DISCONNECTED_CHECK_OPTIONS\"}],\"metaInfo\":{\"timestamp\":\"2020-03-18T08:29:37Z\",\"mapVersion\":\"8.30.106.154\",\"moduleVersion\":\"7.2.202010-6650\",\"interfaceVersion\":\"2.6.76\",\"availableMapVersion\":[\"8.30.106.154\"]}}\n"},{"message":"Request id: c75dd122-3d7c-4364-b4db-ffefc08a5187"}],"response":null,"error_id":"c75dd122-3d7c-4364-b4db-ffefc08a5187","response_code":"400 Bad Request"}

Here is the request from calculateroute.json https://fleet.api.here.com/2/calculateroute.json?app_id=XXX&app_code=XXX&resolution=10&legAttributes=none,links,maneuvers&maneuverAttributes=none,position,notes&linkAttributes=none,shape,roadName,roadNumber,flags,remainTime,remainDistance&rollup=none,country,country%3Btollsys,total&detail=1&commercial=1&currency=EUR&routeAttributes=none,sc,notes,legs,summary,summaryByCountry&shippedHazardousGoods=&driver_cost=15&vehicle_cost=0.7&tollVehicleType=3&mode=fastest%3Btruck%3Btraffic:disabled%3Btollroad:-1&length=16.5&cost_optimize=0&height=4m&weightPerAxle=8t&vehicleNumberAxles=3&vehicleWeight=40t&limitedWeight=40t&emissionType=5&trailersCount=1&trailerType=2&trailerNumberAxles=2&trailerHeight=2m&waypoint0=geo!52.51605,13.37691&waypoint1=geo!48.85718,2.34141&truckRestrictionPenalty=soft

Just to be clear, what I hope for is that if there are no way to avoid toll roads (avoid -1), then return a route with toll roads. Any comments or suggestions about this?

Thanks in advance

Upvotes: 2

Views: 808

Answers (1)

user3505695
user3505695

Reputation:

it looks like there is an issue with the mode that has been passed. I guess that there is a road from point A to point B - which is flagged as both a toll road and a truck route. The combination of toll-free and truck route leaves no available roads out of the area.

If you get a failure like this, try relaxing the constraint (Truck + include toll): e.g. instead of =mode=fastest%3Btruck%3Btraffic:disabled%3Btollroad:0 use one of the following:

Truck + toll - mode=fastest;truck;traffic:disabled;tollroad:0

Upvotes: 1

Related Questions