0

I have a destination that is reachable faster via a way that is not allowed for trucks. Except for when the truck's next stop is near this restricted road. Which option allows me to include this restricted route in the response?

I am looking for a way to include the restricted segment (weight restriction or truck not allowed restriction) in the route of the response.

This is an example request: I tried with onRoadThreshold, but it is not the way to go.

https://router.hereapi.com/v8/routes?apikey=DEFAULT_API_KEY&origin=48.277814,7.393936;onRoadThreshold=40000&destination=48.266218,7.162331;onRoadThreshold=40000&return=polyline,summary,actions&currency=EUR&transportMode=truck&routingMode=fast&vehicle[grossWeight]=25000&vehicle[type]=tractor&traffic[mode]=default

EDIT I am looking for a param like truckRestrictionPenalty=soft which we had in V7 (docs)

enter image description here

1 Answer 1

1

There isn't a direct parameter called "truckRestrictionPenalty" like there was in the HERE Routing API v7. Nonetheless, you can use the {avoid[features]} argument to get a comparable result. You can indicate which features or limitations to avoid during routing by using this parameter.

You can set up the request as follows for your particular situation, where you wish to include a restricted road in the itinerary if the truck's next stop is close to that road:

https://router.hereapi.com/v8/routes?apikey=YOUR_API_KEY&origin=48.277814,7.393936&destination=48.266218,7.162331&return=polyline,summary,actions&currency=EUR&transportMode=truck&routingMode=fast&vehicle[grossWeight]=25000&vehicle[type]=tractor&traffic[mode]=default&avoid[features]=truckRestriction

You are instructing the routing engine to avoid routes that have truck limitations by providing {&avoid[features]=truckRestriction} in this request. The restricted road may still be used by the routing engine, though, if it considerably cuts down on travel time, particularly if the next stop is close to it.

Sign up to request clarification or add additional context in comments.

2 Comments

mmm, I am also taking to routing api v8, but the value "truckRestriction" is not a valid input for the field "avoid[features]" here.com/docs/bundle/routing-api-developer-guide-v8/page/… Example: demo.routing.ext.here.com/#url=https://router.hereapi.com/v8/…
This leads to this route not being able to be configured: demo.routing.ext.here.com/#url=https://router.hereapi.com/v8/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.