WayCategory definitions

Hi,

I’m using ORS in an application where I’m trying to add context to my existing data with further data from OSM. Acquiring extra information such as way types and way categories would be essential to my solution, however, I’m struggling to make sense of the below description as it seems to contradict the API response I get.

This is the test request I’m working with at the moment, a car trip from Budapest to Vienna, almost exclusively on highway and urban streets.

curl -X POST \ 'https://api.openrouteservice.org/v2/directions/driving-car' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8' \ -H 'Authorization: xxx' \ -d '{"coordinates":[[18.9902195,47.4811281],[16.2399765,48.2205998]],"extra_info":["waytype","waycategory"]}'

The response includes the following details:

"waycategory": { "values": [[0, 128, 0], [128, 134, 2], [134, 1127, 3], ... , [1898, 1923, 1], [1923, 2208, 0]], "summary": [{ "value": 3, "distance": 186816.2, "amount": 72.17 }, { "value": 1, "distance": 52595.8, "amount": 20.32 }, { "value": 0, "distance": 18507.1, "amount": 7.15 }, { "value": 2, "distance": 920.3, "amount": 0.36 } ] },

Is there something I’m missing here, or is the docs out of sync with the implementation?

Thanks in advance.

Hi @gyorig,
I’ve just had a quick look and it does seem that that documentation is a bit outdated, so we will look into making sure that it is working correctly soon.

For now though, I believe that the correct codes are:
0 - unclassified/unknown
1 - highway (motorway)
2 - tollway
4 - steps
8 - ferries
16 - fords.

So for your response, 0 would be no category, 1 would be a motorway, 2 would be a tollway (that isn’t a motorway), and 3 would be a motorway that is also a tollway.

Hope that helps

Hi @adam,

thank you, it makes sense this way.

g