2

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

Mustafa
  • 977
  • 3
  • 12
  • 25
Lin Kassem
  • 55
  • 1
  • 9
  • Looking at your arguments, it may be best to simplify your call a bit. You aren't just saying a route from A to B and avoid toll roads, you have a lot more data in there as well that may be causing it to return no routes. – Raymond Camden Mar 18 '20 at 21:29
  • @RaymondCamden, when I remove all the Truck specification attributes, I do get a route. But what if I don't want to remove them? And shouldn't 'tollroad:-1' (avoid) return a route with tolls because no route matched the constraint? – Lin Kassem Mar 19 '20 at 12:06

1 Answers1

1

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
  • But shouldn't tollroad:-1 (avoid) return a route if no route that matches the constraint is found. – Lin Kassem Mar 19 '20 at 10:56
  • just as update & maybe you can help: when I removed the Truck specification attributes from the request, I do get a route. But what if I don't want to remove them? I need these attributes to be in the request to calculate the toll costs – Lin Kassem Mar 19 '20 at 12:08
  • I don't know what to suggest. If a route _must_ match what you sent and you get nothing, that could be reality, right? I.e. nothing works for what you want. – Raymond Camden Mar 19 '20 at 17:26
  • @RaymondCamden, I understand your point & it makes sense. My question is I know 100% that there is a route with tolls between A & B (let's call it R1). When I use mode=''fastest;truck;traffic:disabled;tollroad:-1" I expected the algorithm will not find a route without tolls so it will return (R1). But it didn't. That's my question why did it return an error instead of an empty array in the route object in the result. – Lin Kassem Apr 03 '20 at 09:23
  • At least that's what I understood from the documentation of the 'RouteFeatureWeightType' mentioned here: https://developer.here.com/documentation/routing/dev_guide/topics/resource-param-type-routing-mode.html – Lin Kassem Apr 03 '20 at 09:27