Abnormality in the way_type parameter

I was using the openrouteservice python API for environment modeling. During the same, I have noticed an abnormality.


starting coordinate = [7.754228711128236, 49.42395170409275]
Destination coordinate = [8.659576, 49.875481]

In the step by step direction to the destination, steps 11 to 17 is listed below

11 . {‘distance’: 0.076, ‘duration’: 10.9, ‘type’: 0, ‘instruction’: ‘Turn left onto Europaallee’, ‘name’: ‘Europaallee’, ‘way_points’: [212, 218]}
12 . {‘distance’: 30.899, ‘duration’: 894.8, ‘type’: 7, ‘instruction’: ‘Enter the roundabout and take the 1st exit onto A 6’, ‘name’: ‘A 6’, ‘exit_number’: 1, ‘way_points’: [218, 524]}
13 . {‘distance’: 12.622, ‘duration’: 340.9, ‘type’: 6, ‘instruction’: ‘Continue straight onto A 6’, ‘name’: ‘A 6’, ‘way_points’: [524, 604]}
14 . {‘distance’: 14.858, ‘duration’: 403.3, ‘type’: 6, ‘instruction’: ‘Continue straight onto A 6’, ‘name’: ‘A 6’, ‘way_points’: [604, 717]}
15 . {‘distance’: 11.703, ‘duration’: 328.5, ‘type’: 12, ‘instruction’: ‘Keep left’, ‘name’: ‘-’, ‘way_points’: [717, 777]}
16 . {‘distance’: 24.391, ‘duration’: 673.3, ‘type’: 6, ‘instruction’: ‘Continue straight onto A 67’, ‘name’: ‘A 67’, ‘way_points’: [777, 874]}
17 . {‘distance’: 1.744, ‘duration’: 115.2, ‘type’: 13, ‘instruction’: ‘Keep right’, ‘name’: ‘-’, ‘way_points’: [874, 916]}

From step 12 it is evident that the way_points from 218 to 524 is in Autobahn A 6.
However, when I check it with the way type parameter from client.directions with extra_info=[“steepness”, “surface”, “way type”], there is some abnormality. I have shown the way types output below.

‘waytypes’: {‘values’: [[0, 56, 3],
[56, 157, 1],
[157, 202, 2],
[202, 218, 3],
[218, 220, 2],
[220, 967, 1],
[967, 980, 2],
[980, 1053, 1],
[1053, 1067, 2]],

In the output, I have marked that it says from waypoint 218 to 220, it is 2 (means Road/Autobahn) which is correct, but 220 to 967, it’s 1 (meaning state road/ Bundesstraße).
I am not able to understand why?


the instruction at step 12 states that you Enter the roundabout and take the 1st exit onto A 6, so the waypoints corresponding to the segment will start at the entrance to the roundabout, route via the roundabout and exit the roundabout somewhere onto the A 6.

This can be viewed if you actually decode the waypoints and show them on the map, i.e. via QGIS:

The selected yellow waypoints on the map have vertex_index 218 - 220, showing up in blue in the table on the right and are all three on the roundabout, which is tagged as highway = secondary in OSM.
All waypoints beyond 220 are tagged highway = motorway_link or highway = motorway.

Our internal coding will map

"motorway_link" -> "state road"
"secondary" -> "road"

The mapping of OSM keys onto german way-terms like Bundesstraße or Autobahn is a bit tricky, have a look at the OSM wiki entry for highway and related pages.

Note, that this is not related to our internal mapping mentioned above.

Best regards

1 Like

Aha. That explains something that I have noticed (and mentioned on here quite some time ago), where a generated route takes you off the highway, then makes you enter the same highway immediately, because distancewise (and timewise) it calculates as a little bit shorter (even though I know for sure from experience that staying on the highway is much, much faster). But the fact that link roads are always mapped to highway, explains that particular issue. It also explains why taking an exit off a highway does not show up particularly well in the textual directions (Also see this post I made earlier and this one ).

It would be nice if this could be improved. As it is I would not dare to give these kinds of instructions to some people I know (and might have difficulties with them myself), if all they had were those textual instructions.

1 Like