Cobalt, the OpenStreetMap relation doctor

Back to the map Help

Mapping a relation well

A hiking trail, a bus line or a cycle route is not an OpenStreetMap way: it is a relation that gathers existing ways, in the order they are travelled. This page presents the concepts you need to get it right, with diagrams in the colours of Cobalt's map and editor, then real examples to open on the map.

Basics

To go further, the OpenStreetMap wiki details the conventions: hiking, the type=route relation, cycle routes and node networks.

The direction of a route

A relation has a direction: the order of its members, from first to last. That is what Cobalt's chevrons show (“Direction of travel” box in the panel), and what navigation apps follow.

Direction of travel: chevrons from A to B, in member order A (from)B (to)
Member order: the first way leaves from A (from=*), the last one arrives at B (to=*). A way may be drawn “backwards” in OSM: what counts is the order in the relation.

Forward and backward roles: relative to how the way is drawn

An OSM way has its own direction, the one it is drawn in (from first to last node), unrelated to the direction of the route. Roles are read relative to that drawing:

So “forward” does not mean “outbound”: an outbound branch split into several ways drawn in different directions mixes both roles, and so does the return branch. A real example on the Véloscénie:

Véloscénie, section via Limours: outbound along avenue Saint-Laurent (red), return by a cycle track and rue de Paris (blue), shared section in both directions (cyan); small white arrows: drawing direction of each OSM way outbound: forward (drawn in travel direction) forward return, cycle track: backward (drawn westwards, travelled eastwards) return, rue de Paris: forward, oneway=yes start ↙↙ rest of the relation
Véloscénie, section via Limours, avenue Saint-Laurent and rue de Paris Colours as in JOSM's PT Assistant plugin: red = travelled outbound only, blue = on the return only, cyan = both directions; the small white arrows give the drawing direction of each way, and the animated highlights the cyclist's journey. Outbound, avenue Saint-Laurent is one-way (oneway=yes) and drawn in the travel direction: role forward. On the return, the cycle track is drawn westwards but travelled eastwards: role backward; then rue de Paris, one-way and drawn eastwards: role forward, even though it is on the return. See this passage the cycle track (w702252720) rue de Paris (w671514020)

Travelling from A to B, then from B to A

Like KPN (knooppuntnet), Cobalt travels every two-ended hiking, cycling or horse route from first to last member, then from last to first, following the roles and one-way restrictions of the route's mode:

It reports a role contrary to the one-way restriction (forward on a one-way way against its drawing direction), a one-way way without a role (the route only passes it in one direction), and a route that can only be travelled in one direction, or in none. It also checks the access tags of the mode, from the most specific to the most general: bicycle then vehicle then access by bike, foot then access on foot, horse then access on horseback; a horse=no stretch on a horse route or vehicle=no on a cycle route is reported. These checks run in the nightly analysis.

Hiking, cycling, climbing, node networks: major differences

TypeTagsWhat matters
Hikingroute=hiking (or foot), network iwn, nwn (GR), rwn (GRP), lwn (PR)Continuous route, roles approach, alternative, connection; waymarking in osmc:symbol; difficulty (sac_scale) on the ways, not on the relation.
Cyclingroute=bicycle (or mtb), network icn (EuroVelo), ncn, rcn, lcnMany one-way streets: forward / backward; long routes are split into stages or sections (superroute); the surface (surface) matters more than for hiking.
Climbingclimbing=route routes (node or way), grouped in a climbing=crag site; via ferrata as highway=via_ferrata or a route=via_ferrata relationA climbing route is not a continuous route: no gap to look for, but a grade (climbing:grade:*) and a length. Only via ferrata relations are analysed as routes.
Node networksnetwork:type=node_network, numbered nodes rwn_ref / rcn_refEach relation only links two neighbouring nodes and has no name: the whole network makes the route. A short relation without a loop is normal.

The colours of the map and the editor

One route, several renderings

The “Route colour” selector in the panel redraws the same routes according to what you are looking for: their status for Cobalt, or what the tags of their ways say. Here is the same route, six ways, in five ways:

Status The whole route in one colour: green OK, yellow to watch, red broken.
Difficulty sac_scale of each way: from T1 (green) to T4 (red).
Surface surface: paved (grey), dirt or gravel (brown), unknown (dotted).
Access access, foot: tolerated (yellow dashes), private or forbidden (semi-transparent red dashes).
Danger Passages on busy roads (highway primary, secondary…) or a reported obstacle (hazard).

The other renderings: date of last change, type of problem, member order, reference or colour (colour) of the relation.

A network of junction nodes

Node network: numbered junctions linked in pairs, each link is a relation 12 27 31 40 13 28 32 41 relation 12-27relation 27-31
Node network (wiki): each junction carries a number on the ground (rwn_ref for hiking, rcn_ref for cycling), and each link between two neighbouring junctions is a small unnamed relation (network:type=node_network). You plan your route by writing down a sequence of numbers (12, 27, 31, 40…): no relation covers the whole journey, and a short relation linking only two nodes is normal.

OK routes with very different shapes

All these relations are “OK” for Cobalt: their shape is intended, and it can be read from the member order and their roles.

Linear route: from start A to finish B, ways numbered in order AB 1234
Line from a start point to a finish (roundtrip=no), ways in order 1, 2, 3, 4. Chemin des Jaupins (asp14)
Loop: the last way comes back to the start start = finish
Loop (roundtrip=yes): the last way touches the first one. Circuit de la Chapelle des Buis
Lollipop: a stem travelled out and back, then a loop startout and back
Lollipop: a stem travelled twice, out and back, and a loop at the end. The stem is drawn as a double line. Tour du Poey (asp27)
Access: short-dotted approaches from a station and a car park to the main route station (approach)car park (approach)
Access: ways with role approach (from a station, a car park) or connection (to another route). They do not count in the continuity of the main route. Circuit des deux Rivières

Stages and sets of loops

A long route (a GR, a cycle route) is rarely a single relation: it is split into stages, each a complete relation, listed in order in a parent relation (type=superroute, or type=route whose members are relations). Likewise, a network of small loops starting from the same village can be gathered in a relation that groups them.

Route in three stages, each a relation, starts marked with numbered pins 1 2 3 stage 1stage 2stage 3
Stages: each stage is checked separately (its gaps, its order), and the parent relation lists them in order. Cobalt marks the start of each stage with a numbered white pin (“Relation stages” box) and the “Route sets” section colours each stage. Porta del Cel (in stages)
Set of three loops starting from the same village, each a relation village PR 1 (5 km)PR 2 (3 km)PR 3 (8 km)
Set of loops: three short hikes (PR) start from the same village. Each one is a complete loop (roundtrip=yes) with its own ways; the shared start and the shared sections appear in each of them. A relation grouping them (the town's “PR network”) only has relations as members and is never “broken” because its loops do not follow one another.
The Véloscénie (V40), from Paris to Mont-Saint-Michel: a parent relation and its sections, one per département or per variant Mont-Saint-Michel Paris MancheOrnevia Carrouges Eure-et-Loirvia Bucvia Limours Versaillessouth Paris
The Véloscénie (V40) From Paris to Mont-Saint-Michel, the Véloscénie is a superroute relation whose members are eight relations: one per département (Manche, Orne, Eure-et-Loir), the two ways of leaving Île-de-France (via Buc or via Limours), the variant via Carrouges, the entry into Paris (south Paris) and the excursion to Versailles. Each section is checked separately, and the continuity of the whole is checked over all their ways: when this page was written, the Eure-et-Loir section was broken, and the whole Véloscénie fell apart into two pieces. The Véloscénie Eure-et-Loir section section via Limours

Sub-relations

A relation can have other relations as members: these are its sub-relations. They show up in several common constructions:

What Cobalt checks and shows:

Good practice: a parent relation does not mix ways and sub-relations. Ways go in the stages; the parent relation only lists the stages, in order.

Why a member can pass the same place several times

The member list describes a journey, not a drawing: when the hiker uses the same way twice, that way appears twice in the relation, at its place in the travel order. This is intended, and it lets apps compute the real length and elevation profile of the route.

Figure-of-eight: two loops joined by a shared stem travelled out then back start 2 passages
Figure-of-eight: you set off along the shared stem, do the right-hand loop, come back along the same stem, then do the left-hand loop. The stem is twice in the relation, once in each direction: double line, highlights moving in opposite directions.
Castle tour: around two castles, out and back along a road to a viewpoint, return to the village village castle Acastle B viewpoint road: out and back return via the valley
Castle tour: from the village, you go round castle A, then castle B, follow a road to a viewpoint and come back along the same road before going down to the village through the valley. Only the viewpoint road is travelled twice: it appears twice in the relation (out, then back) and Cobalt draws it as a double line; the castle rounds, done only once, stay as a solid line.

Cobalt draws these ways as a double outline (two thin lines on either side) instead of a solid line, on the map as in the editor. On the other hand, the same way pasted twice in a row for no reason is reported as a “duplicate member” (to watch).

How difficult routes are shown

Difficulty is tagged on the ways, with sac_scale (Swiss Alpine Club scale, from T1 to T6), completed if needed by trail_visibility and via_ferrata_scale. In the “Difficulty” colour mode, Cobalt colours each route by its most difficult passage:

The “Danger” mode separately shows passages on busy roads and reported obstacles (hazard), and the “Difficulty at most” filter in the panel hides routes that are too demanding. A route none of whose ways has a sac_scale is “without stated difficulty”: a checkbox lets you keep it or not.

Passages on private land, tolerated or forbidden

Tolerated passage: a stretch in yellow dashes in the middle of the route access=permissiveprivate land, passage tolerated
Tolerated: the way crosses private land whose owner lets people through. Keep access=private if that is the general case, and add foot=permissive (or access=permissive). Yellow dashes on the map: the route stays OK.
Forbidden passage: a stretch in red dashes, the route is to watch foot=no / access=nono access for pedestrians
Forbidden: access=private with no tolerance, access=no or foot=no. Red dashes, and the route becomes “to watch” (“forbidden passage” issue). If the restriction is real, the route must be diverted along an allowed way, not the tag removed: tags describe the ground, the relation follows what is allowed.

Example of a route using a forbidden passage: Chemin d'Assise, Cluny - Montcenis

Broken cases, and how to fix them

Each diagram shows the relation as Cobalt draws it, and the text below what to do. Cobalt's editor offers the fix in most cases: “Edit” button on the relation, then follow its suggestions.

Gap: two separate pieces, a pink arc links both ends missing way
Gap: two consecutive members do not touch. Add the missing way (or draw it in the editor, from one edge of the gap to the other), or connect both ways to the same node. De Le Revest au Coudon
Unsorted members: ways continuous on the ground but numbered out of order 3142
Unsorted members: the route is continuous, but the list is not in travel order. The editor can sort the members in one click.
Deleted way: an orange stretch that no longer exists way deleted or replaced
Deleted way: someone erased or redrew a way, and the relation lost that member. The relation's history (in Cobalt) shows the old shape in orange: add the way that replaced it.
Stray member: a way far from the route stray member
Stray member: a way added by mistake, unrelated to the rest. Remove it, or give it a role (approach, alternative) if it makes sense. Sentier du Sel
Open loop: roundtrip=yes but the last way does not come back to the start the loop does not close
Open loop: the relation says it is a loop (roundtrip=yes) but does not come back to the start. Add the last ways, or fix the tag if it is a line. Tour Bilboquet-Barescou (asp01)
Unmarked fork: two branches without a role from the same point variant?
Unmarked fork: two branches leave the same point without a role. Give the variant the alternative role (or put it in its own relation), or separate outbound and return with forward / backward.
Missing sub-relation: a stage missing from a long route stage 2?
Missing sub-relation: a long route made of stages points to a relation that was deleted or is outside France. Recreate it or remove the link. Porta del Cel
Duplicate member: the same way twice in a row 12 = 23
Duplicate member: a way pasted twice in a row, with no out-and-back. Remove the duplicate (not to be confused with intended repeated passages). De Ollioules à Bandol

The full list of issues, breaking or to watch, is in the help. Each fix earns points: the more reasons the relation had to be broken, the more it earns.

Examples taken from the relations analysed by Cobalt (data © OpenStreetMap contributors, ODbL licence); their status may have changed since this page was written. A question? Write to CipherBliss.