Skip to content

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 form the graph building, Accept means that the tag indicates that the way should be included, and Conditional means that the tag is taken into account during the filtering process, but the acceptance/rejection is based on other tags and logic.

All ways are initially rejected from the graph building unless criteria for acceptance has been met!

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

Tag combinationRejectAcceptConditional
highway != * AND route != [shuttle_train, ferry]:heavy_check_mark:
highway != * AND route = [shuttle_train, ferry] AND firstValue = restrictedValues:heavy_check_mark:
highway != * AND route = [shuttle_train, ferry] AND ( firstValue = intendedValues OR firstValue != * AND foot != * AND bicycle != * ):heavy_check_mark:
highway = track AND tracktype = *:heavy_check_mark:
highway != [motorway, motorway_link, motorroad, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, unclassified, residential, living_street, service, road, track]:heavy_check_mark:
impassable = yes OR [status, smoothness] = impassable:heavy_check_mark:
firstValue = restrictedValues:heavy_check_mark:
firstValue = intendedValues:heavy_check_mark:
highway = ford OR ford = *:heavy_check_mark:
maxwidth < 2:heavy_check_mark:

Driving HGV ๐Ÿšš ๐ŸšŒ ๐Ÿšœ โ€‹

The profile differs from the above logic for driving car in the definitions of

restrictedValues = [private, no, restricted, military]
intendedValues = [yes, permissive, designated, destination, hgv, goods, bus, agricultural, forestry, delivery]

and the following addition rule:

Tag combinationRejectAcceptConditional
restrictions=restrictedValues AND !(restrictions=intendedValues) AND !([hgv, goods, bus, agricultural, forestry, delivery]=intendedValues):heavy_check_mark:

cycling-regular ๐Ÿšฒ [cycling-electric, cycling-road & cycling-mountain] โ€‹

Definitions:
restrictions = [bicycle, vehicle, access]
restrictedValues = [private, no, restricted, military, emergency]
intendedValues = [yes, designated, official, permissive]

Tag combinationRejectAcceptConditional
(man_made = pier OR railway = platform OR ( route = [shuttle_train, ferry] AND (bicycle = yes OR ( bicycle != * AND foot != *)))) AND !(restrictions = restrictedValues):heavy_check_mark:
highway != [cycleway, path, footway, pedestrian, track, service, residential, living_street, steps, unclassified, road, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link]:heavy_check_mark:
sac_scale = hiking AND highway = cycleway:heavy_check_mark:
cycling-regular, cycling-electric:
sac_scale != hiking

cycling-road:
sac_scale = *

cycling-mountain:
sac_scale != [hiking, mountain_hiking, demanding_mountain_hiking, alpine_hiking]
:heavy_check_mark:
bicycle = intendedValues OR bicycle = dismount OR highway = cycleway OR bicycle_road = yes:heavy_check_mark:
highway = [motorway, motorway_link] OR motorroad = yes:heavy_check_mark:
highway = ford OR ford = *:heavy_check_mark:
restrictions = restrictedValues:heavy_check_mark:
ELSE * = *:heavy_check_mark:
Tag combinationRejectAcceptConditional
sac_scale != hiking:heavy_check_mark:
foot = [yes, designated, official, permissive]:heavy_check_mark:
foot = [private, no, restricted, military, emergency]:heavy_check_mark:
access = [private, no, restricted, military, emergency]:heavy_check_mark:
sidewalk = [yes, both, left, right]:heavy_check_mark:
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]:heavy_check_mark:
motorroad = yes:heavy_check_mark:
highway = ford OR ford = *:heavy_check_mark:

The following are applicable only when no highway tag has been provided for the way

Tag combinationRejectAcceptConditional
route = [shuttle_train, ferry] AND (foot != * OR foot = yes):heavy_check_mark:
railway = platform:heavy_check_mark:
man_made = pier:heavy_check_mark:

Hiking โ€‹

Tag combinationRejectAcceptConditional
sac_scale != [hiking, mountain_hiking, demanding_mountain_hiking, alpine_hiking]:heavy_check_mark:
foot = [yes, designated, official, permissive]:heavy_check_mark:
foot = [private, no, restricted, military, emergency]:heavy_check_mark:
access = [private, no, restricted, military, emergency]:heavy_check_mark:
sidewalk = [yes, both, left, right]:heavy_check_mark:
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]:heavy_check_mark:
motorroad = yes:heavy_check_mark:
highway = ford OR ford = *:heavy_check_mark:

The following are applicable only when no highway tag has been provided for the way

Tag combinationRejectAcceptConditional
route = [shuttle_train, ferry] AND (foot != * OR foot = yes):heavy_check_mark:
railway = platform:heavy_check_mark:
man_made = pier:heavy_check_mark:

Wheelchair โ€‹

Tag combinationRejectAcceptConditional
motorroad = yes:heavy_check_mark:
wheelchair = [yes, designated, official, permissive, limited]:heavy_check_mark:
wheelchair = [private, no, restricted]:heavy_check_mark:
highway = steps:heavy_check_mark:
foot = [yes, designated, official, permissive, limited]:heavy_check_mark:
foot = [private, no, restricted]:heavy_check_mark:
sac_scale = *:heavy_check_mark:
sidewalk = [yes, both, left, right]:heavy_check_mark:
sidewalk = [no, none, separate, detached] AND highway = [trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, road]:heavy_check_mark:
highway = ford OR ford = *:heavy_check_mark:
(bicycle = [designated, official] OR horse = [designated, official]) AND [foot, access, wheelchair] = [yes, designated, official, permissive, limited]:heavy_check_mark:
highway = [bridleway, cycleway]:heavy_check_mark:
highway = [footway, pedestrian, living_street, residential, unclassified, service, trunk, trunk_link, primary, primary_link, secondary, secondary_link, tertiary, tertiary_link, road path, track]:heavy_check_mark:

The following are applicable only when no highway tag has been provided for the way

Tag combinationRejectAcceptConditional
route = [shuttle_train, ferry] AND wheelchair = [yes, designated, official, permissive, limited]:heavy_check_mark:
route = [shuttle_train, ferry] AND wheelchair = [private, no, restricted]:heavy_check_mark:
route = [shuttle_train, ferry] AND foot = [yes, designated, official, permissive, limited]:heavy_check_mark:
route = [shuttle_train, ferry] AND foot = [private, no, restricted]:heavy_check_mark:
(public_transport = platform OR railway = platform) AND wheelchair = [yes, designated, official, permissive, limited]:heavy_check_mark:
(public_transport = platform OR railway = platform) AND wheelchair = [private, no, restricted]:heavy_check_mark:
(public_transport = platform OR railway = platform) AND foot = [yes, designated, official, permissive, limited]:heavy_check_mark:
(public_transport = platform OR railway = platform) AND foot = [private, no, restricted]:heavy_check_mark: