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
- Relation: an OSM object with no geometry of its own. Its tags describe the route:
type=route,route=hiking(orbicycle,bus…),name,ref(“GR 10”, “PR 4”),network(iwn,nwn,rwn,lwn: international, national, regional, local),colourandosmc:symbolfor the waymarking. - Members: the ways travelled, and sometimes nodes (start, stops) or other relations
(stages of a long route, grouped by a
route_masteror parent relation). - Order: ways are sorted in travel order, from start to finish. Two ways that follow each other in the list must touch at an end: that is continuity.
- Roles: empty for the main route;
forward/backwardfor a way travelled in one direction only;approachfor an access path (from a car park, a station);connectionfor a link to another route;alternativefor a variant. - Splitting ways: a route that follows only part of a way needs that way split at the junction, otherwise the route overflows.
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.
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:
forward: the route uses this way in the direction it is drawn, and only in that direction;backward: it uses it against the direction it is drawn, and only in that direction;- no role: in both directions.
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:
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)roundtrip=yesmarks a loop;roundtrip=no, a line with a start and a finish.- A route waymarked in both directions does not need to be doubled: a single relation is enough, member order
gives the “reference” direction (the guidebook's, for example); only the passages where outbound and return
split take
forward/backwardroles. - When a way is reversed in an editor (its drawing direction flipped), its role must switch from
forwardtobackwardor the other way round: JOSM and iD do it by themselves; check it after a script or an import.
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:
- by bike:
oneway, except contraflow cycling (oneway:bicycle=no,cycleway=opposite_lane,cycleway:left:oneway=no…); - on foot: only
oneway:foot(a one-way street for cars does not apply to pedestrians); - on horseback:
oneway, oroneway:horsewhen given.
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
| Type | Tags | What matters |
|---|---|---|
| Hiking | route=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. |
| Cycling | route=bicycle (or mtb), network icn
(EuroVelo), ncn, rcn, lcn | Many one-way streets:
forward / backward; long routes are split into stages or sections
(superroute); the surface (surface) matters more than for hiking. |
| Climbing | climbing=route routes (node or way), grouped in a
climbing=crag site; via ferrata as highway=via_ferrata or a
route=via_ferrata relation | A 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 networks | network:type=node_network, numbered nodes
rwn_ref / rcn_ref | Each 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
- OK
- to watch
- broken
- selected relation
- gap (two ends that should meet)
- editor draft
- way missing today
- tolerated passage
- private or forbidden passage
- double line: way travelled twice
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:
sac_scale of each way: from T1 (green) to T4 (red).surface: paved (grey), dirt or gravel (brown), unknown (dotted).access, foot: tolerated (yellow dashes), private or forbidden (semi-transparent red dashes).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
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.
roundtrip=no), ways in order 1, 2, 3, 4.
Chemin des Jaupins (asp14)roundtrip=yes): the last way touches the first one.
Circuit de la Chapelle des Buisapproach (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èresStages 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.
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.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 LimoursSub-relations
A relation can have other relations as members: these are its sub-relations. They show up in several common constructions:
- Route in stages: a
type=superroute(ortype=route) relation whose members are each a complete stage, in travel order (the Véloscénie above). - Public transport line: a
type=route_masterrelation groups thetype=routerelations of each direction and each variant of a bus, tram or train line. These sub-relations do not follow one another: each one is a separate journey. - Network: a
type=networkrelation gathers the routes of a network, or a relation groups the loops of a town (set of loops, above). - Site: a
type=siterelation gathers the features of one place (a charging station and its charging points, a campus); its members are mostly nodes and ways.
What Cobalt checks and shows:
- Missing sub-relation (broken relation): a member points to a relation that was deleted or is missing from the analysed extract; recreate it or remove the link.
- Sub-relation of another type (to watch): a
superrouteor aroute_mastercontains a relation that is not a route, often a member added by mistake. - The continuity of a parent relation is checked over all the ways of its stages: a gap in a stage, or between two stages, makes the parent relation broken too.
- In a relation's sheet, the family tree shows its parents and children over three levels, with their status, and checks that each stage joins the next one (shared node, otherwise the distance in metres).
- On the map, the “Relation stages” box marks the start of each sub-relation with a numbered pin, and the “Route sets” section colours each stage of a set.
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.
- Out and back on an approach, or to a viewpoint or a summit: the way appears on the way out, then again on the way back.
- Shared stem of a figure-of-eight loop, or of a lollipop (“lollipop” diagram above).
- One-way sections: when outbound and return use two different ways, use the
forwardandbackwardroles instead.
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:
- T1 hiking (
hiking) - T2 mountain hiking (
mountain_hiking) - T3 demanding mountain hiking
- T4 alpine hiking
- T5 demanding alpine hiking
- T6 difficult alpine hiking
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
access=private if that is the general case, and add foot=permissive (or
access=permissive). Yellow dashes on the map: the route stays OK.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.
approach, alternative) if it makes sense.
Sentier du Selroundtrip=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)alternative role (or put it in its own relation), or separate outbound and return with
forward / backward.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.