Junctions

From OpenStreetMap Wiki
(Redirected from Intersection)
Jump to navigation Jump to search
Logo. Feature: Junctions
One example for Feature: Junctions
Description
Related to junctions between roads
Tags

See Editing Standards and Conventions#Junctions for editing basics.

Road intersections

Simple intersections

A simple intersection is represented by the ways for the two roads sharing a common node.

Dual carriageway intersections

When a single carriageway intersects a dual carriageway (on the same level), the junction is represented by two nodes and a small section of the single carriageway (left image). When two dual carriageways intersect, the junction is represented by four nodes and four small sections (right image).

height=200px height=200px

When all sections of a carriageway have the same attributes, they can be represented by a single OSM-way going through. Once attributes are different, such as having turn:lanes=* or destination=* mapped, they become split into individual OSM-ways.

Representing a road area by a linear OSM-way is an abstraction for routability. In analogy, the four nodes and the inner way sections of a dual carriageway junction are an abstraction from the real junction area (grey in the example images), also required for routing. This can however lead to problems for assigning tags to an inner way section (such as q in the pictures) if the continuations of the way in both directions outside the junction (f and h) have different tags. The topic was discussed in this thread, on which most of the following explanation is based.

  • The blue segments p and q might be given a name=* of either B-road or C-road, or given no name at all. (If B-road and C-road have the same name, then this issue does not apply and p and q should also have that name.) At this time, there is no universally recommended method for tagging the name=* of p and q, but factors that can be considered in making the decision include:
    • Minimizing the complexity of the OSM data: One choice might allow q to be represented as part of the same OSM way as f or h, while another might require q to be a separate short OSM way.
    • Effect on directions produced by routers: For a route that includes q, routers might use the name=* of q in the generated directions. This is mainly an issue for the left turn n-q-f[1], for which the router has to choose which road name to use in the step "Turn left on [name]"; users would expect "Turn left on B-road". Routers behave as follows (based on various tests between 2025-06-14 and 2026-09-13):
      • OSRM and Valhalla have a heuristic to ignore short inner way segments and say "Turn left on B-road" regardless of the name=* of q.
      • GraphHopper uses the name=* of q and doesn't give a name at all if the tag doesn't exist.
      • OsmAnd uses the name=* of q if the tag exists, otherwise it uses the name=* of f.

      Tagging q with name=B-road gives the desired result in all of these routers.

      In theory, this method has a downside: for the route h-q-m, a router might say "Continue straight for a few meters on B-road" before turning left, which would be confusing. If q were named C-road or had no name at all, then the extra step would presumably be omitted, which would be better. However, in the discussion thread, no example was offered of a router that actually behaves that way. So as far as routing is concerned, it seems clear that tagging q with name=B-road is the best choice for an intersection of two dual carriageways.

      Unfortunately, when a single carriageway changes name at an intersection with a dual carriageway (as in the left image), there is no choice of the name of p that gives the ideal result in all routers for both of the routes b-p-e and c-p-g. Naming p either B-road or C-road gives the wrong name for one of the two routes in both OsmAnd and GraphHopper, while leaving p unnamed is good for OsmAnd but causes GraphHopper to report no name at all for either route, which is arguably a greater inconvenience to the user than reporting the wrong name.
    • Making data look uniform: If B-road/C-road changes both its name and some other prominent attribute (such as highway=* classification) at its intersection with A-road, then it could look weird to have the two attributes change at different points. Furthermore, in the right image, optimizing the tagging for good directions as described above would lead to q being tagged name=B-road and p being tagged name=C-road, so the name appears to change at misaligned points on the two carriageways (see this image). The misalignment could be argued to be ugly, though it could equally well be argued that this method has a sort of rotational symmetry and it's ugly to arbitrarily break the symmetry in favor of giving both p and q one of the two names. Probably none of these concerns are serious in practice because in typical renderers, the names of p and q are distinguishable only at high zoom levels.
  • The destination=* should be tagged on the outer segments where things are unambiguous.
  • For assigning the highway=* classification tag to an inner section, principles that can be applied include: (1) hiding roads below a given classification should leave a coherent road network and (2) the junction should look good in renderers. These two principles often lead to the same conclusion, simply because higher-class roads are rendered more prominently than lower-class roads. Usually, the conclusion is to use the higher of the two classifications (which can be achieved by letting that OSM way extend into the inner section), but there are exceptions. For example, when a motorway ends at a dual carriageway intersection, extending the highway=motorway into the inner sections would violate the principle that a motorway should not have at-grade intersections.

Roundabouts

Roundabouts should be tagged as junction=roundabout. Small roundabouts where the middle can be traversed by vehicles should be tagged as highway=mini_roundabout.

Traffic control

Intersections with stop signs should be tagged highway=stop. Intersections with traffic signals should be tagged highway=traffic_signals.

Mapbox recommendations on mapping junctions (archived link, original page now offline)

Waterway crossing

A ford (where automobiles, pedestrians, or horses enter the water to cross a stream or river) should be tagged as ford=*.

Rail/road level crossings

Rail/road level crossings should be tagged as railway=level_crossing.

Pedestrian road crossings

Main article: Crossings

Pedestrian road crossings (UK: zebra crossings; US: crosswalks) should be tagged as highway=crossing. Pedestrian rail crossings should be tagged railway=crossing.

Proposals

  • highway=junction: Proposal for mapping the extent of junctions and to reduce the number of needed relations

Notes

  1. For convenience, this discussion assumes driving on the right. The same ideas apply to driving on the left, with the appropriate reversals.