OSM tags for routing/Valhalla
Valhalla is a free, open-source routing service that lets you integrate routing and navigation into a web or mobile application. The following tables contain the default logic for the Valhalla routing tags.
The access tags are overridden with the country specific tags. Access Restrictions
OSM tags for routing (ways):
OSM tag | Auto Routing | Bus Routing | Pedestrian Routing | Bicycle Routing |
highway=motorway
|
Yes | Yes | No | No |
highway=motorway_link
|
Yes | Yes | No | No |
highway=trunk
|
Yes | Yes | Yes | Yes |
highway=trunk_link
|
Yes | Yes | Yes | Yes |
highway=primary
|
Yes | Yes | Yes | Yes |
highway=primary_link
|
Yes | Yes | Yes | Yes |
highway=secondary
|
Yes | Yes | Yes | Yes |
highway=secondary_link
|
Yes | Yes | Yes | Yes |
highway=residential
|
Yes | Yes | Yes | Yes |
highway=residential_link
|
Yes | Yes | Yes | Yes |
highway=service
|
Yes | Yes | Yes | Yes |
highway=tertiary
|
Yes | Yes | Yes | Yes |
highway=tertiary_link
|
Yes | Yes | Yes | Yes |
highway=road
|
Yes | Yes | Yes | Yes |
highway=track
|
Yes | Yes | Yes | Yes |
highway=unclassified
|
Yes | Yes | Yes | Yes |
highway=undefined
|
No | No | No | No |
highway=unknown
|
No | No | No | No |
highway=living_street
|
Yes | Yes | Yes | Yes |
highway=footway
|
No | No | Yes | No |
highway=pedestrian
|
No | No | Yes | No |
highway=steps
|
No | No | Yes | Yes |
highway=bridleway
|
No | No | No | No |
highway=construction
|
No | No | No | No |
highway=cycleway
|
No | No | No | Yes |
highway=path
|
No | No | Yes | Yes |
highway=bus_guideway
|
No | Yes | No | No |
Access tags (ways):
Note: Darker shading in a cell indicates the key is not applicable to that type of routing.
Key | Value | Outcome/Comments | Auto Routing | Bus Routing | Pedestrian Routing | Bicycle Routing |
access | no | Sets access flag to false | No | No | No | No |
access | yes | Sets access flag to true. | Yes | Yes | Yes | Yes |
access | private | Sets private flag to true. A route can only start or end on a way that is marked as private. | Yes | Yes | Yes | Yes |
access | destination | Sets no_thru_traffic to true. A route can only start or end on a way that is marked as no_thru_traffic. | Yes | Yes | Yes | Yes |
motorcar/motor_vehicle | no | Overrides access flags. Motorcar tag is checked first. | No | |||
motorcar/motor_vehicle | yes | Overrides access flags.
Motorcar tag is checked first. |
Yes | |||
bus/psv/lanes:psv:forward | no | Overrides access flags.
Bus tag is checked first. |
No | |||
bus/psv/lanes:psv:forward | yes
|
Overrides access flags.
Bus tag is checked first. |
Yes | |||
busway | lane | Overrides access flags. | Yes | |||
busway:left and busway:right | lane | Overrides access flags. | Yes | |||
foot/pedestrian | no | Overrides access flags.
Foot tag is checked first. |
No | |||
foot/pedestrian | yes | Overrides access flags.
Foot tag is checked first. |
Yes | |||
bicycle/cycleway | no
|
Overrides access flags.
Bicycle tag is checked first. |
No | |||
bicycle/cycleway | yes | Overrides access flags.
Bicycle tag is checked first. |
Yes | |||
route | ferry | If access not already set, then enable access for each type of routing. | Yes | Yes | Yes | Yes |
service | driveway | If access not already set, then enable access for each type of routing. | Yes | Yes | Yes | Yes |
Oneway tags (ways):
Key | Value | Outcome/Comments |
oneway | -1 | Sets reverse flag to true for all types of routing. A value of -1 will flip the direction of the oneway. |
junction | roundabout | Sets auto backward to false. Sets roundabout flag. |
cycleway/cycleway:left/cycleway:right | opposite | Overrides oneway flag. Sets bike reverse flag to true. |
oneway:bicycle | -1 | Overrides oneway flag. Sets bike reverse flag to true. A value of -1 will flip the direction of the oneway for bicycles. |
busway/lanes:psv:backward | busway:
|
Overrides oneway flag. Sets bus reverse flag to true.
|
oneway:bus | -1 | Overrides oneway flag. Sets bus reverse flag to true. A value of -1 will flip the direction of the oneway for bus. |
cycleway:both
|
shared_lane | Bike forward and backward overrides. Sets bike forward and backward to true. |
cycleway:right and cycleway:left
|
shared_lane | Bike forward and backward overrides. Sets bike forward and backward to true. |
busway | lane | Bus forward and backward overrides.
Sets bus forward and backward to true. |
busway:right and busway:left | lane | Bus forward and backward overrides.
Sets bus forward and backward to true. |
lanes:bus | 1 | Bus forward override.
Sets bus forward to true. All other types of routing are turned off. |
lanes:bus | 2 | Bus forward and backward overrides.
Sets bus forward and backward to true. All other types of routing are turned off. |
Bicycle tags (ways):
Key | Value | Outcome/Comments |
cycleway | shared_lane | Determines if the bike lane is shared, dedicated, or separated. |
cycleway:right or cycleway:left | shared_lane | Determines if the bike lane is shared, dedicated, or separated. |
ncn/rcn/lcn | yes | Sets bitmask for network. |
ncn_ref=* /rcn_ref=* /lcn_ref=*
|
* | Also will set bitmask for network. |
General tags (ways):
Key | Value | Outcome/Comments |
access=*
|
* | |
service=*
|
* | Sets the use. |
name=*
|
* | Street name (Official) |
name:en=*
|
* | Street name (Alternate) TODO: Will support multiple languages. |
name_alt=*
|
* | Street name (Alternate) |
official_name=*
|
* | Street name (Official) |
maxspeed=*
|
* | Speed. If no speed is set, then default speed is assigned based on highway tag. TODO: Country speed limit defaults.
default_speed in kilometers
trunk* = 90, primary* = 75, secondary* = 60, tertiary* = 50, unclassified = 40, residential* = 30, other = 20 |
ref=*
|
* | ref is set to unsigned_ref if unsigned_ref exists and name, name:en, alt_name, official_name, ref, and int_ref do not exist and highway is equal to motorway, trunk, or primary. |
int_ref=*
|
* | |
surface=*
|
* | |
lanes=*
|
* | |
tunnel | yes | Sets tunnel flag to true. |
tunnel | no | Sets tunnel flag to false. |
toll | yes | Sets toll flag to true. |
toll | no | Sets toll flag to false. |
route | ferry | |
railway | rail | If auto access, then this is a auto train. |
bridge | yes | Sets bridge flag to true. |
seasonal | If not equal to no... | Sets seasonal flag to true. |
hov=*
|
If not equal to no... | Sets HOV flag to true. |
destination=*
|
* | Toward location. Used for exit information. |
destination:ref=*
|
* | Branch route number. Used for exit information. |
destination:ref:to=*
|
* | Toward route number. Used for exit information. |
destination:street=*
|
* | Branch road name. Used for exit information. |
destination:ref:street:to=*
|
* | Toward road name. Used for exit information. |
junction:ref=*
|
* | Junction/exit number. Used for exit information. |
OSM tags for routing (nodes):
Key | Value | Outcome/Comments |
name=*
|
* | Street name (Official) |
access | no | Sets access flag to false. |
access | yes | Sets access flag to true. |
motorcar/motor_vehicle | no | Overrides access flags. Motorcar tag is checked first. |
motorcar/motor_vehicle | yes | Overrides access flags.
Motorcar tag is checked first. |
bus/pvs | no | Overrides access flags.
Bus tag is checked first. |
bus/psv | yes
|
Overrides access flags.
Bus tag is checked first. |
foot | no | Overrides access flags. |
foot | yes | Overrides access flags. |
bicycle | no
|
Overrides access flags.
|
bicycle | yes | Overrides access flags.
|
ref=*
|
* | Junction/exit number. Used for exit information. |
exit_to=*
|
* | Branch route number/road name. And/or...
Toward route number/road name. And/or… Toward location. Used for exit information. |
barrier | gate | Sets gate flag to true. |
barrier | bollard | Sets bollard flag to true. Auto access turned off. |
bollard | rising | If bollard flag equals true, then set bollard flag to false and gate tor true. |
barrier | toll_booth | Sets tollbooth flag to true. |
toll=*
|
* | Toll information. TODO. |
payment=*
|
* | Payment information. TODO. |
fee=*
|
* | Fee information. TODO. |
amenity | bicycle_rental | Bike rental. TODO. |
shop and service:bicycle:rental | shop:
service:bicycle:rental: |
Bike rental. TODO. |
traffic_signals:direction | forward | Traffic signal direction. |
traffic_signals=*
|
* | Sets the traffic signal flag. |
OSM tags for routing (route relations):
Key | Value | Outcome/Comments |
type | route | |
route | road | |
network=*
|
* | |
ref=*
|
* | |
member.role |
|
Posted travel direction. |
OSM tags for routing (administrative relations):
Key | Value | Outcome/Comments |
type | boundary | |
boundary | administrative | |
admin_level | 2 | Generalized to 2 and 4. Only save a few at 3, 4, and 6. Examples: 3 = Guadeloupe, 4 = Abkhazia, 6 = District of Columbia |
name=*
|
* | Street name (Official) |
name:en=*
|
* | Street name (Alternate) TODO: Will support multiple languages. |
ISO_3166-1=*
|
* | If admin_level equals 2, then set iso_code to ISO3166-1:alpha2 if exists; otherwise, ISO3166-1. |
ISO_3166-2=*
|
* | If admin_level equals 4, then set iso_code to ISO3166-2. |