Tag Filtering
During the graph build process, openrouteservice looks at various tags that are given to OSM ways as a means of identifying whether that way should be included into the routing graph or not. For example, in the foot profile any ways that are marked as highway=motorway
are rejected and not included in the graph, meaning that they can never be routed over (for that profile).
The following tables list what tags are taken into account during the initial filtering process. Reject
means that the tag value indicates that the way is explicitly rejected from graph building. Accept
means that the tag indicates that the way should be included. Conditional
means that the tag is taken into account during the filtering process, but the acceptance/rejection is based on other tags and logic, such as the :conditional
suffix.
Support of temporal restrictions is limited to seasonal access restrictions, such as vehicle:conditional=no @ (Nov 1-Mar 31)
. These restrictions are being resolved at graph build time. Other time-dependent conditional restrictions are currently not being taken into account. This means, in particular, that ways which are regularly open but conditionally closed, or vice versa, remain accepted or rejected, respectively.
The order of items is important, as in many cases a more generic "catch" is introduced towards the end of processing if it has not already been explicitly rejected/accepted.
Notation:
italic words are variables defined for the respective section and group several tags.monospace code
are tags from OpenStreetMap.[square brackets]
denote a range of possible tags.*
denotes any tag, key != *
denotes the absence of key
.
Driving car
Definitions:
restrictedValues = [private, agricultural, forestry, no, restricted, delivery, military, emergency]
intendedValues = [yes, permissive, destination]
restrictions = [motorcar, motor_vehicle, vehicle, access]
firstValue = value of the first encountered key from restrictions
wayTypesWithDefaultSpeed = [motorway, motorway_link, motorroad, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, unclassified, residential, living_street, service, road, track]
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
highway != * AND route != [shuttle_train, ferry] | ✔️ | ||
highway != * AND route = [shuttle_train, ferry] AND firstValue = restrictedValues | ✔️ | ||
highway != * AND route = [shuttle_train, ferry] AND ( firstValue = intendedValues OR firstValue != * AND foot != * AND bicycle != * ) | ✔️ | ||
highway = track AND tracktype > grade3 | ✔️ | ||
highway != wayTypesWithDefaultSpeed | ✔️ | ||
impassable = yes OR [status, smoothness] = impassable | ✔️ | ||
firstValue = restrictedValues | ✔️ | ||
firstValue = intendedValues | ✔️ | ||
highway = ford OR ford = * | ✔️ | ||
maxwidth < 2 | ✔️ | ||
Default case: Accept if not conditionally restricted | ✔️ |
Driving HGV
The profile differs from the above logic for driving car in the definitions of
Definitions:
restrictedValues = [private, no, restricted, military]
intendedValues = [yes, permissive, designated, destination, hgv, goods, bus, agricultural, forestry, delivery]
restrictions = [hgv, motorcar, motor_vehicle, vehicle, access]
and the following additional rule which replace the check for ford
:
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
!(restrictions=intendedValues) AND (highway = ford OR ford = * ) | ✔️ | ||
!(restrictions=intendedValues) AND restrictions=restrictedValues AND !([hgv, goods, bus, agricultural, forestry, delivery] =intendedValues) | ✔️ | ||
Default case: Accept if not conditionally restricted | ✔️ |
cycling-regular [cycling-electric, cycling-road & cycling-mountain]
Definitions:
restrictions = [bicycle, vehicle, access]
restrictedValues = [private, no, restricted, military, emergency]
intendedValues = [yes, designated, official, permissive]
wayTypesWithDefaultSpeed = [unclassified, tertiary_link, primary_link, bridleway, tertiary, living_street, trunk, motorway_link, steps, motorway, secondary, path, residential, road, service, footway, pedestrian, track, secondary_link, cycleway, trunk_link, primary, construction]
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
highway != * AND (man_made = pier OR railway = platform OR ( route = [shuttle_train, ferry] AND (bicycle = yes OR ( bicycle != * AND foot != * )))) AND !(restrictions = restrictedValues) | ✔️ | ||
highway != wayTypesWithDefaultSpeed | ✔️ | ||
sac_scale = hiking AND highway = cycleway | ✔️ | ||
cycling-regular, cycling-electric:sac_scale != hiking cycling-road: sac_scale = * cycling-mountain: sac_scale != [hiking, mountain_hiking, demanding_mountain_hiking, alpine_hiking] | ✔️ | ||
bicycle = intendedValues OR bicycle = dismount OR highway = cycleway OR bicycle_road = yes | ✔️ | ||
highway = [motorway, motorway_link, bridleway, construction] OR motorroad = yes | ✔️ | ||
highway = ford OR ford = * | ✔️ | ||
restrictions = restrictedValues if not conditionally permitted | ✔️ | ||
Default case: Accept if not conditionally restricted | ✔️ |
Foot
Definitions:
restrictions = [foot, access]
restrictedValues = [private, no, restricted, military, emergency]
intendedValues = [yes, designated, permissive, official]
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
sac_scale != hiking | ✔️ | ||
foot = intendedValues | ✔️ | ||
restrictions = restrictedValues | ✔️ | ||
sidewalk = [yes, both, left, right] | ✔️ | ||
highway != [footway, path, steps, pedestrian, living_street, track, residential, service, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, cycleway, unclassified, road] | ✔️ | ||
motorroad = yes | ✔️ | ||
highway = ford OR ford = * | ✔️ | ||
Default case: Accept if not conditionally restricted | ✔️ |
The following are applicable only when no highway tag has been provided for the way
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
route = [shuttle_train, ferry] AND (foot != * OR foot = yes ) | ✔️ | ||
railway = platform | ✔️ | ||
man_made = pier | ✔️ | ||
waterway = lock_gate AND foot = intendedValues | ✔️ | ||
restrictions = restrictedValues Reject if not conditionally permitted | ✔️ | ||
Default case: | ✔️ |
Hiking
Same as Foot except for different sac_scale
check with existing highway
tag.
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
sac_scale != [hiking, mountain_hiking, demanding_mountain_hiking, alpine_hiking] | ✔️ |
Wheelchair
Definitions:
restrictions = [foot, wheelchair, access]
restrictedValues = [private, no, restricted, military, emergency]
intendedValues = [yes, limited, designated, permissive, official]
The following check is done first, regardless of the highway
value:
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
restrictions = restrictedValues AND restrictions != intendedValues AND sidewalk != [yes, both, left, right] | ✔️ |
If highway
is present on the way:
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
sac_scale = [mountain_hiking, demanding_mountain_hiking, alpine_hiking, demanding_alpine_hiking, difficult_alpine_hiking] | ✔️ | ||
surface = [ sand, salt, grass, snow, earth, dirt, ice, mud] | ✔️ | ||
smoothness = [bad, very_bad, horrible, very_horrible] | ✔️ | ||
tracktype = [grade4, grade5] | ✔️ | ||
wheelchair = intendedValues | ✔️ | ||
wheelchair = restrictedValues | ✔️ | ||
highway = [steps, construction] | ✔️ | ||
foot = intendedValues | ✔️ | ||
foot = restrictedValues | ✔️ | ||
sidewalk = [yes, both, left, right] | ✔️ | ||
sidewalk = [no, none, separate] | ✔️ | ||
motorroad = yes | ✔️ | ||
highway = ford OR ford = * | ✔️ | ||
highway = bridleway AND foot != intendedValues AND wheelchair != intendedValues | ✔️ | ||
highway = [footway, pedestrian, living_street, residential, unclassified, service, tertiary, tertiary_link, road, trunk, trunk_link, primary, primary_link, secondary, secondary_link, path, track, bridleway] | ✔️ | ||
Default case: | ✔️ |
The following are applicable only when no highway
tag has been provided for the way
Tag combination | Reject | Accept | Conditional |
---|---|---|---|
route = [shuttle_train, ferry] AND wheelchair = intendedValues | ✔️ | ||
route = [shuttle_train, ferry] AND wheelchair = restrictedValues | ✔️ | ||
route = [shuttle_train, ferry] AND foot = intendedValues | ✔️ | ||
route = [shuttle_train, ferry] AND foot = restrictedValues | ✔️ | ||
(public_transport = platform OR railway = platform ) AND wheelchair = intendedValues | ✔️ | ||
(public_transport = platform OR railway = platform ) AND wheelchair = restrictedValues | ✔️ | ||
(public_transport = platform OR railway = platform ) AND foot = intendedValues | ✔️ | ||
(public_transport = platform OR railway = platform ) AND foot = restrictedValues | ✔️ | ||
Default case: | ✔️ |