Directions - driving-hgv - max. Weight in Belgium

Hello,

I want to get the route for the following coordinates. But the route should not go through Belgium because the truck weight of 48 tons exceeds the max. weight of 44 in Belgium. So the route should go only within Netherlands. However, the following request gives as result always the route through Belgium:

{“coordinates”:[[“5.9318229”,“51.0735644”],[“4.0841827”,“51.2689451”]]
,“instructions”:1,“options”:{“vehicle_type”:“hgv”, “profile_params”:{“restrictions”:{“weight”:48}}},“preference”:“recommended”,“units”:“km”,“geometry”:true}

How do I have to change the request to get something like the following route? Isn’t the route service considering the max. national weights?

Thank you in advance!

Hi @noeand,

please don’t use left- & right quotation mark in JSON or code.

You can add to options:
"options":{"avoid_borders":"all"}

or avoid specific countries (belgium) with:
"options":{"avoid_countries":[65]}

Also check the API documentation for further options.

Weight limits are taken from the OSM data and afaik national data is currently only used for speed limits.

If that’s something you would like to see in openrouteservice, please open an Issue in the repository and provide some info the the feature request.

Best regards

Hi @amandus ,

thank you!

I have already tried these options (Belgium has the country code 17. 65 is Falkland Islands). But then no route can be found at all, returning the error code 2009 with the message:

“Route could not be found - Unable to find a route between points 1 (5.9318229 51.0735644) and 2 (4.0841827 51.2689451).”

So, for me it seems that the algorithm cannot find the route which circumnavigates Belgium because it is too far away from the “optimal” route. Is there a way to force the openroute service to find the route in Netherlands?

Thanks.

Best Regards

Ah yes, i read the wrong column. That has happend to me with this table before :sweat_smile: .

I don’t think it’s too far away, but that it’s an issue with the HGV restriction as it finds this route for the car profile for this body:

{"coordinates":[[5.9318229,51.0735644],[4.0841827,51.2689451]],"options":{"avoid_countries":[17]},"units":"km"}

But not if you switch to hgv for the same body.

My guess is that it’s this entry to the tunnel that is the only line for hgv of all the line and it also has a tag of motorcar=no which is probably, why it is rejected for hgv by our tag filtering

Best regards

1 Like