How to enable bus lanes in yml config file as hgv

Hi, I am trying to do a route for a bus that uses bus lanes. The closest profile I can choose in the yml file is driving-hgv but I don’t know if is some option that enables the bus lanes or gives them priority over a normal street.
I have read some sub-profile of buses and the option to put bus=yes but I can’t see where should I put it.

Thanks.

Hi @Carlos_Garcia,

you pass the vehicle type to the request like this:

  curl -X POST \
  'https://api.openrouteservice.org/v2/directions/driving-hgv' \
  -H 'Content-Type: application/json; charset=utf-8' \
  -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \
  -H 'Authorization: your-api-key' \
  -d '{"coordinates":[[8.681495,49.41461],[8.686507,49.41943],[8.687872,49.420318]],"options":{"vehicle_type":"bus"}}'

please also read our docs:
https://openrouteservice.org/dev/#/api-docs/v2/directions
Best regards

Hi @amandus, thanks for your fast answer.
However, after applying it I can’t see it is following the bus lanes or busways.
The api returns me the route marked in red. And if it goes through the bus lanes it should return the blue one i drew manually.
Furthermore I can’t see in the map it recognizes it as a street, but in the layer of transport it does in the second image so it must be the information stored in some point.

I guess I am missing something to tell the API to route first through the bus lanes.

Thanks again.

Yeah it’s a bit irritating that it doesn’t render in the normal osm basemap…

One issue could be with the bus tag, which is set to permit instead of yes or designated (see osm wiki transport mode restrictions)

An other issue, that i didn’t check, could be that the bus lanes are not properly connected to the rest of the roadnetwork.

Feel free to open an issue in the ors repo with detailed explanation.

Best regards