OSM tags for routing/Valhalla

From OpenStreetMap Wiki
Jump to navigation Jump to search

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

agricultural

discouraged

forestry

official

Sets access flag to false No No No No
access yes

private

permissive

use_sidepath

delivery

designated

dismount

destination

customers

public

allowed

restricted

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

customers

delivery

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

agricultural

discouraged

forestry

official

Overrides access flags. Motorcar tag is checked first. No
motorcar/motor_vehicle yes

private

permissive

use_sidepath

delivery

designated

dismount

destination

customers

public

allowed

restricted

Overrides access flags.

Motorcar tag is checked first.

Yes
bus/psv/lanes:psv:forward no

delivery

Overrides access flags.

Bus tag is checked first.

No
bus/psv/lanes:psv:forward yes

designated

urban

permissive

restricted

destination


Note: Additional values for psv and lanes:psv:forward only:

bus

1

2

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

agricultural

discouraged

forestry

official

Overrides access flags.

Foot tag is checked first.

No
foot/pedestrian yes

private

permissive

sidepath

delivery

designated

destination

customers

public

crossing

sidewalk

allowed

passable

footway

restricted

Overrides access flags.

Foot tag is checked first.

Yes
bicycle/cycleway no

none


Overrides access flags.

Bicycle tag is checked first.

No
bicycle/cycleway yes

designated

use_sidepath

permissive

destination

dismount

lane

track

shared

shared_lane

sidepath

share_busway

allowed

private

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

yes

true

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

opposite_lane

opposite_track

Overrides oneway flag. Sets bike reverse flag to true.
oneway:bicycle -1

yes

true

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:

opposite

opposite_lane


lanes:psv:backward:

bus

yes

designated

permissive

1

2

Overrides oneway flag. Sets bus reverse flag to true.


Busway tag is checked first.

oneway:bus -1

yes

true

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

share_busway

shared

opposite_track

track

opposite_lane

lane

Bike forward and backward overrides. Sets bike forward and backward to true.
cycleway:right and cycleway:left


shared_lane

share_busway

shared

opposite_track

track

opposite_lane

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

share_busway

shared

opposite_track

track

opposite_lane

lane

Determines if the bike lane is shared, dedicated, or separated.
cycleway:right or cycleway:left shared_lane

share_busway

shared

opposite_track

track

opposite_lane

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


motorway* 105,

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

true

1

tag:tunnel=building_passage

Sets tunnel flag to true.
tunnel no

false

0

Sets tunnel flag to false.
toll yes

true

1

interval

snowmobile

Sets toll flag to true.
toll no

false

0

Sets toll flag to false.
route ferry
railway rail If auto access, then this is a auto train.
bridge yes

true

1

Sets bridge flag to true.
seasonal If not equal to no... Sets seasonal flag to true.
hov=*

hov:lanes=*

hov:minimum=*

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

agricultural

discouraged

forestry

official

Sets access flag to false.
access yes

private

permissive

use_sidepath

delivery

designated

dismount

destination

customers

public

allowed

restricted

Sets access flag to true.
motorcar/motor_vehicle no

agricultural

discouraged

forestry

official

Overrides access flags. Motorcar tag is checked first.
motorcar/motor_vehicle yes

private

permissive

use_sidepath

delivery

designated

dismount

destination

customers

public

allowed

restricted

Overrides access flags.

Motorcar tag is checked first.

bus/pvs no

delivery

Overrides access flags.

Bus tag is checked first.

bus/psv yes

designated

urban

permissive

restricted

destination


Note: Additional values for psv:


bus

1

2

Overrides access flags.

Bus tag is checked first.

foot no

agricultural

discouraged

forestry

official

Overrides access flags.
foot yes

private

permissive

sidepath

delivery

designated

destination

customers

public

crossing

sidewalk

allowed

passable

footway

restricted

Overrides access flags.
bicycle no

none



Overrides access flags.



bicycle yes

designated

use_sidepath

permissive

destination

dismount

lane

track

shared

shared_lane

sidepath

share_busway

allowed

private

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

lift_gate

Sets gate flag to true.
barrier bollard

block

removable

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:

bicycle_rental

service:bicycle:rental:

yes

Bike rental. TODO.
traffic_signals:direction forward

backward

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 Role North

Role South

Role East

Role West

Posted travel direction.

OSM tags for routing (administrative relations):

Key Value Outcome/Comments
type boundary
boundary administrative
admin_level 2

3

4

6

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.