Route directions

From OpenStreetMap Wiki
Jump to navigation Jump to search
Reassurance markers for a "wrong-way concurrency". This road simultaneously carries the northbound lanes of Interstate 77 and U.S. Route 52 and the southbound lanes of Interstate 81 and U.S. Route 11.
Some bicycle route networks are signposted with cardinal directions in the same manner as road routes.
In South Africa, route markers incorporate cardinal directions in English and sometimes Afrikaans.

In several countries, a road route is typically considered to travel north–south or west–east.[1] Cardinal directions accompany route shields on all signage, including reassurance markers and guide signs. In everyday speech, people refer to the "westbound" or "eastbound" lanes of a road. This usage has also carried over to bicycle routes in many areas. The following countries are known to associate cardinal directions with routes:

  • Canada (including Québec)
  • Costa Rica and other SICA countries[2]
  • Mexico
  • New Zealand
  • South Africa and other SADC countries[3]
  • United States (including Puerto Rico)
  • Venezuela[4]

In these countries, the cardinal direction is an intrinsic property of (one side of) the route. It is not a destination (as in some Vienna Convention countries), and it is not necessarily the actual direction that every stretch of road along the route travels. For example, if a road carrying a north–south route curves briefly, the signs keep saying "North" and "South"; they do not switch to saying "West" and "East" at the curve. A route that has a directional suffix in its number, such as Interstate 35W, still has two route directions associated with it, i.e., "I-35W North".

Cardinal directions rarely appear on rendered maps, where a single shield would represent both directions of a route at once. However, users do expect cardinal directions to be included in guidance instructions during turn-by-turn navigation.

Mapping route directions

There are two ways to map route directions.

One relation per direction

The most robust approach is to create three type=route relations:

  • One for the northbound or westbound lanes, tagged direction=north or west, respectively
  • One for the southbound or eastbound lanes, tagged direction=south or east, respectively
  • A "superrelation" that contains the other two relations and has the same tags as them, except for direction=*

direction=* is always set to an English value in lowercase, even in French-speaking parts of Canada and Spanish-speaking Puerto Rico.

If a highway=* way carries both the northbound and southbound lanes of a route, then the way should be a member of both the northbound and southbound route relations. In other words, the superrelation should contain only relations, no ways, even if the route travels along some undivided roads.

This approach has several advantages:

  • It is compatible with a wide variety of data consumers and quality assurance tools, because it is consistent with road routes globally and other kinds of routes.
  • A router can consistently refer to a cross street as "State Route 123 West" even if it is undivided.
  • The direction=* key can accommodate uncommon directions, such as inner and outer, without necessarily requiring data consumers to add special handling for them.

Unfortunately, JOSM assigns the same label to all three relations, making it difficult to select the correct one from a list. As a workaround for this editor limitation, it is common to set name=* to a human-readable name with a disambiguating suffix, for example State Route 10 (south).

iD's Road Route preset has a Direction field that sets direction=* to a cardinal direction, which forms part of the relation's label in relation lists throughout the application.

One relation per direction per leg

A route may already have child relations representing "legs" of the route. For example:

  • A long route that spans multiple states may be divided into one route relation per state, tagged with various is_in:state=* values. State highway departments may differ on the route's assigned direction because they only consider the direction of the route within their respective states. Wikidata may have distinct items for the route segments within each state.
  • A long route may be divided into several route relations at arbitrary points along the route, tagged with various from=* and to=* values, because it is considered risky for a relation to have more than 300 members.
  • A beltway switches between north–south and west–east at four locations.
  • A road may carry part of a route without any markers for the route (a partially "unsigned" route).

In these cases, there needs to be a separate relation per direction per leg. It is unclear whether the superrelation's members need to be sorted. For example:

  • relation Interstate 90 (super) contains 26 member relations, two per state.
  • relation Ohio State Route 104 contains four member relations, two for the east–west leg and two for the north–south leg. Within the child relations, each of the member ways has Role forward or Role backward, because the route traverses undivided, two-way streets.

Some routes are even organized into an intermediate level of relations for the legs. For example, here is the hierarchy for Clark County Route 215, which is shaped like the letter C:

Cardinal directions as roles

The alternative approach is to keep the whole route as a single bidirectional relation and use the role of each member way to indicate the cardinal direction along that way. [1] For example, in relation Ohio State Route 562, each member way has either Role west or Role east as its role in the relation. The role is always set to an English value in lowercase, even in French-speaking parts of Canada and Spanish-speaking Puerto Rico.

This approach was recommended for many years in the U.S. community. As of 2017, 75% of Interstate route relations had cardinal directions as member roles. [2] Historically, tagging cardinal directions was only considered necessary along divided highways. For a route that mainly traverses undivided highways except for a brief divided segment, tagging a role on a few ways is much more convenient than adding every way to two relations.

Unfortunately, this approach conflicts with other uses of relation roles, especially Role forward and Role backward, which indicate that a two-way road carries the route in only one direction:

  • If a two-way road is a member of a State Route 123 relation with Role east, but the way happens to go north–south, a data consumer would be unable to reliably determine the progression of the route. If instead it has Role forward, the data consumer would be unable to reliably associate the way with a cardinal direction.
  • relation Ohio State Route 104 primarily goes north–south, but the east–west leg traverses some undivided, two-way streets. Therefore, it would be necessary to apply both Role forward and Role west to the same way.

Moreover, because editors and quality assurance tools do not widely support cardinal directions as roles, they sometimes become inconsistent and broken as roads and relations get edited over time.

Statistics

There is considerable overlap between the two styles of mapping, not least because a given way can carry a concurrency of multiple routes, each mapped in a different manner. In the following tables, a way that has a cardinal direction role within a unidirectional relation is only counted as part of a unidirectional relation. Even though there are several times as many bidirectional relations as unidirectional relations, bidirectional relations have significant gaps. Whereas a unidirectional relation is guaranteed to provide cardinal direction information along the entire route, cardinal direction roles only cover a fraction of the bidirectional relations that rely on them.

Directional mapping styles by relation (August 2021)
Network Relations Unidirectional relations Bidirectional relations
with cardinal direction roles
CA:ON:primary [3] 115 6 24
CA:QC:A [4] 68 34 14
NZ:SH [5] 50 0 0
US:CA [6] 293 88 5
US:I [7] 996 242 412
US:OH [8] 537 4 79
US:TX [9] 256 6 35
US:US [10] 1,706 96 448
Direction mapping styles by distance (August 2021)
Network Total Unidirectional relations Bidirectional relations Cardinal direction roles
in bidirectional relations
Missing cardinal direction roles
in bidirectional relations
CA:QC:A [11] 00000000000043714,371 km
(2,716 mi)
0000000000000611611 km
(380 mi)
00000000000037603,760 km
(2,340 mi)
00000000000028522,852 km
(1,772 mi)
0000000000000908908 km
(564 mi)
CA:ON:primary [12] 000000000001430814,308 km
(8,891 mi)
0000000000000313313 km
(194 mi)
000000000001403614,036 km
(8,722 mi)
00000000000030953,095 km
(1,923 mi)
000000000001094110,941 km
(6,798 mi)
NZ:SH [13] 00000000000094839,483 km
(5,892 mi)
00000000000000000 km
(0 mi)
00000000000094839,483 km
(5,892 mi)
00000000000000000 km
(0 mi)
00000000000094839,483 km
(5,892 mi)
US:CA [14] 0000000013280.7513,280 34 mi
(21,373.3 km)
0000000002765.252,765 14 mi
(4,450.2 km)
00000000010634.510,634 12 mi
(17,114.6 km)
000000000000001515 mi
(24 km)
00000000010619.510,619 12 mi
(17,090.4 km)
US:I [15] 0000000098466.7598,466 34 mi
(158,466.9 km)
0000000030436.2530,436 14 mi
(48,982.4 km)
00000000068600.568,600 12 mi
(110,401.8 km)
000000000004293142,931 mi
(69,091 km)
0000000025669.2525,669 14 mi
(41,310.7 km)
US:OH [16] 000000000001604816,048 mi
(25,827 km)
00000000000110.5110 12 mi
(177.8 km)
000000000001594715,947 mi
(25,664 km)
00000000000021082,108 mi
(3,392 km)
000000000001383913,839 mi
(22,272 km)
US:TX [17] 000000000001704617,046 mi
(27,433 km)
0000000000319.75319 34 mi
(514.6 km)
0000000016793.7516,793 34 mi
(27,026.9 km)
0000000001070.251,070 14 mi
(1,722.4 km)
0000000015723.2515,723 14 mi
(25,304.1 km)
US:US [18] 0000000189664.25189,664 14 mi
(305,235.0 km)
00000000015555.515,555 12 mi
(25,034.2 km)
0000000176585.25176,585 14 mi
(284,186.4 km)
000000000003493934,939 mi
(56,229 km)
0000000000141646141,646 mi
(227,957 km)

Mapping route directions as destinations

Tag the on-ramp or off-ramp way (or the destination_sign relation) with destination:ref=* set to the same value as the destination way's ref=*, followed by a space and the cardinal direction, capitalized as on the sign. For example, a ramp leading to eastbound U.S. Route 50 Truck is tagged destination:ref=US 50 Truck East. The cardinal direction always comes last, even if it appears above or to the left of the shield on a guide sign.

In French-speaking parts of Canada, the cardinal direction is tagged in French, while in Puerto Rico, it is tagged in Spanish. As of 2021, destinations with route directions are not tagged in a more structured form, so data consumers must take care to parse destination:ref=* in English, French, or Spanish, depending on the region.

Software support

OSRM and Valhalla include cardinal directions in turn instructions based on direction=*, destination:ref=*, or relation roles, whichever is present.

See also

Relevant Sophox queries:

Notes and references

  1. This concept is sometimes called a "route direction", "inventory direction", or "cardinality", but usually it is merely referred to as a cardinal direction.
  2. “Manual Centroamericano de Dispositivos Uniformes para el Control del Tránsito” (in es). Guatemala: Secretariat for Central American Economic Integration. January 2015. ch. 2, p. 77. 
  3. “Road Traffic Sign Manual”. Southern African Development Community. May 2012. §11.1.7. 
  4. Osario, Wilmer (June 27, 2022). “Re: Shields of Venezuela”. openstreetmap-americana. Retrieved June 27, 2022.