Cycle Routes (National/Local) from OSM ways & relations

From #121 and #146 we know there is a requirement to have named cycle routes (both Local - lcn, and National -ncn) included within the data packs.

These networks are represented in OSM data with the lcn (Local Cycle Network) and ncn (National Cycle Network) tags. Such tags are present on ways (legacy tagging) and relations (preferred way of mapping).

We can obtain OSM “lines” (ways) and “multilinestrings”/“other_relations” (relations) data from osmextract within oe_get() specifying the layer paramater.

Data from the relations layer (multilinestring & other_relations), by default, contains a number of extra tags than returned from the “lines” layer. Most notably:

  • route=* - this key describes the type of route relation. i.e. “foot”, “bicycle”, “bus”

  • network=* - this key indicates the scope of the route described. i.e. route=“bicycle” & network=“ncn” implies a cycle route that is part of a national cycle network route. See below for a list of possible cycle route values.

  • cycle_network=* due to generic use of “lcn”, “ncn”, “icn” in cycle route realtions, this tag may be used in places that require more granular network distinctions.



Possible cycle & walking route values

Sourced: Bicycle, hiking and other recreational routes –> Cycle routes relations

It is preferred to tag the cycle routes using relations instead of tagging the ways. But please check that a relation doesn’t already exist for your chosen route before creating one. Links to country-specific overview pages of cycle networks are below.

The tags on the relation are slightly modified from the standard tags. An example cycle route relation would have the following tags:

Tag Comment
type=route
route=bicycle/mtb See mountainbike for details on tagging mountainbike routes.
network=icn/ncn/rcn/lcn Specify the network as an international route, a national route, a regional route, or a local route, as per the normal tagging of cycle routes. For tagging mountainbike routes more specific look here mountainbike
cycle_network=* (optional) In countries that have (for instance) multiple regional route networks, this tag indicates the specific route system, much the way network=* does on road route relations.
ref=number (optional) Numerical part of reference code of the route. (This formal limit was introduced originally to cater for a certain renderer, so using the full code should be fine too, as long as it can be read from signs along the route.) The network or cycle_network tag already distinguishes the type, so just use “ref” and not “ncn_ref” or similar.
name=* (optional) The name of the route e.g. Jubilee Cycle Way
state=proposed (optional) Routes are sometimes not official routes pending some negotiation or development – the opencyclemap rendering shows these routes dotted.
distance=distance in km (optional) The distance covered by a route in km
ascent=ascent in m (optional) The ascent covered by a route in meters. If a route has start and end point at different altitude use descent too
descent=descent in m (optional) The descent covered by a route in meters. Use it only if it differs from the ascent (different altitude at start/endpoint of a route).
roundtrip=yes/no (optional) Use roundtrip=no to indicate that a route goes from A to B. Use roundtrip=yes to indicate that the start and finish of the route are at the same location (circular route).
colour=* (optional) To indicate the official colour associated with a route. In the Waymarked Trails cycling map, the displayed ref/name of a route gets underlined in this colour (example).

Further information on UK cycle routes, sourced from the UK cycle routes OSM wiki, is below:

Screenshot from 2022-10-11 12-52-10



Data

Required Tags

Tags required for the analysis of cycle routes include:

minimum_tags = c("lcn", "lcn_ref", "ncn", "ncn_ref", "type", "route", "network", "cycle_network", "name")

Tag Justifications

  • lcn|lcn_ref|ncn|ncn_ref - these tags describe if a way is part of a national or local cycling network. *_ref is additional information on the network (i.e. ncn_ref 1 implies way is part of ncn 1)

  • type - relation specific common key used to mark a relations type (important as we want to parse the “routes” values)

  • route - relation specific common key used to mark what a relation captures (important as we want route relations for “bicycle”, rather than say “bus”)

  • network - relation specific key that indicates the scope of a relation (typical values are lcn, ncn, rcn, icn)

  • cycle_network - relation specific key to indicate more granular network descriptions (i.e. GB:London Cycle Network)

  • name - standard OSM tag that allows naming of features. This tag is only useful for relations where a name covers the entire relation, unlike ways, where the name=* key will be the name of the current way



Processing

Ways Layer

Note that this is the legacy method for tagging lcn & ncn routes. Ideally this should now be done via a relation, rather than tagging highways with lcn=* / ncn=*.

Processing steps applied to ways layer to obtain ways that form parts of a lcn / ncn route:

  • 1 - ways lcn/ncn keys must be == “yes|proposed”

  • 2 - ways lcn_ref/ncn_ref are optional. These keys indicate what route a way is apart of (i.e. ncn = “yes” & ncn_ref = 1 –> route: NCN 1)

And that is it!

Whilst the name tag is useful for relations (relations will typically be named by name with the route they capture i.e. Surrey Cycleway), when considering ways the name key indicates the name of the current way, and not any relations that may contain it (i.e. although this way may be part of the Surrey Cycleway relation, its specific way name = “Long Lane Road”)

Relation Layer

Processing steps applied to relations layer to obtain lcn & ncn routes.

  • 1 - relations type key must be == “route” (we want relations of cycle routes)

  • 2 - relations route key must be == “bicycle” (we want cycling routes, not bus routes for example)

  • 3 - relations network key must be == “lcn|ncn” (want relations that capture local and national cycle routes only)

  • 4 - relations cycle_network key is optional. Provides a more specific description of the cycle route that just ncn 5 (i.e. GB:London Cycle Network). If not NA, use this as a name/descriptor

  • 5 - relations name key is optional, but for relations this will often describe the name of the route captured by the relation (i.e. LCN 25 or Surrey Cycleway)

Common key values for ways and relations

Common type key values.
Common route key values.
Common network key values.
Common cycle_network key values.

Common lcn key values.
Common ncn key values.

Note that *_ref key values for ncn & lcn routes do not have common key values, as this field acts as a reference field for information on the cycle route (i.e for National Cycle Network 5, then ncn_ref = 5)