Skip to content
Outdoor Tags

Outdoor Tags

The road layer carries the OpenStreetMap outdoor tags alongside the usual road classification, so you can filter or recolour paths by difficulty, by route network, or by what they are made of. This is the data behind the Hiking and Cycling styles, and it is available to any style you write.

None of these fields is invented. They come through from OpenStreetMap as mapped, with the two hiking and via ferrata grades rewritten to the short notation of the two scales the Swiss Alpine Club (SAC) uses, the SAC-Wanderskala and the SAC-Klettersteigskala. The club’s own leaflets, linked in the table, explain each grade, and the map legend links them from the difficulty rows. Coverage varies: a well-mapped alpine region will have sac_scale on most paths, and a lightly mapped one will have it on almost none. Always provide a fallback for a missing value.

Difficulty grades

FieldSchemeValues
sac_scaleSAC hiking scale (SAC-Wanderskala)T1 through T6
mtb_scaleMountain bike difficulty (OSM mtb:scale, as mapped)0 through 6
via_ferrata_scaleSAC via ferrata scale (SAC-Klettersteigskala, after Hüsler)K1 through K6, plus the in-between ranges K1/K2 through K5/K6

sac_scale is the SAC hiking grade: the OSM words hiking through difficult_alpine_hiking become T1 through T6. It is the one most worth using. The step from T2 to T3 is roughly where a path stops being suitable for someone in trainers, so it is a natural place to split a trail app’s filter.

via_ferrata_scale is set on type=via_ferrata only. The OSM numeric grade 1 to 6 becomes K1 to K6; a +/- modifier or a half step becomes the range between the two grades, so 2+, 2.5 and 3- all read K2/K3. OSM grade 0 has no SAC grade and is dropped. Print the value as it is, it is already the label a climber expects.

Route networks

FieldWhat it is
walking_networkMembership of a walking route network: iwn international, nwn national, rwn regional, lwn local
cycling_networkThe same four levels for cycle route networks: icn, ncn, rcn, lcn

Network membership is how you tell a waymarked long-distance route from a footpath that happens to run in the same direction. The Hiking and Cycling styles use it to decide which routes get a shield and which do not.

Surface and access

FieldWhat it is
surfaceSurface as mapped, for example asphalt, gravel, ground, rock, sand
bicycleWhether cycling is permitted, and how
accessGeneral access restrictions
subtypeThe path or way subtype, which is what the outdoor styles filter on

Filtering by difficulty

Dim anything above a chosen grade rather than hiding it, so the map still shows that a path exists while making clear it is out of scope. Hiding it entirely tends to make people think the map is wrong.

map.addLayer({
  id: 'paths-by-difficulty',
  type: 'line',
  source: 'mtk',
  'source-layer': 'road',
  filter: ['has', 'sac_scale'],
  paint: {
    'line-color': [
      'match', ['get', 'sac_scale'],
      'T1', '#2e7d32',
      'T2', '#f9a825',
      'T3', '#ef6c00',
      ['T4', 'T5', 'T6'], '#c62828',
      '#9e9e9e'
    ],
    'line-width': ['interpolate', ['linear'], ['zoom'], 12, 1.2, 16, 3],
    'line-dasharray': [2, 1]
  }
});

To show only the paths a casual walker can use, filter rather than colour:

filter: ['all',
  ['has', 'sac_scale'],
  ['in', ['get', 'sac_scale'], ['literal', ['T1', 'T2']]]
]

Route shields from the network

map.addLayer({
  id: 'named-routes',
  type: 'line',
  source: 'mtk',
  'source-layer': 'road',
  // International and national routes only, which keeps a busy region readable.
  filter: ['in', ['get', 'walking_network'], ['literal', ['iwn', 'nwn']]],
  paint: { 'line-color': '#c2185b', 'line-width': 3, 'line-opacity': 0.7 }
});

Further Reading