Mapbox OpenStreetMap

OpenStreetMap is the free and editable map of the world, created and maintained by a huge international community. Mapbox Streets, our customizable map layer of streets, buildings, and places from all around the world, is powered by open data from OpenStreetMap. Anybody can create an account and start editing on OpenStreetMap.org within minutes.

Our data team updates OpenStreetMap based on quality analysis and customer feedback. Our principle is to work in the open, these mapping guides are primarily consolidated and maintained by our data team for various mapping projects and on-boarding new team members.

You are welcome to join one of our open mapping projects over on the issue queue and use these best practice mapping guides. These guides are licensed under Public Domain (CC0), if you would like to contribute or have an feedback on these, please feel free to raise an issue in this repository.

Modeling Roads for Map Navigation

Mapping guides

Modeling Roads for Map Navigation

A navigation map is influenced by several road characteristics, such as the turn restrictions, improper way of road tracing and road classification. The most important ones among those are:

Road geometry

Roads are the main features that are used for rendering a route in all navigational applications. Correct road mapping leads not only to the well-looking map but also to better navigation experience. With the change in the shape of the traced road, the distance covered will be altered which affects the route. The common approach for road mapping is to trace roads following the center-line from satellite imagery.

road_with_two_lanes

Roads on satellite imagery

Road connectivity / topology:

If you want to travel from point A to point E as shown in the below image, you can either travel from A to B, B to C and then C to E or A to B, B to D and then D to E.

screen shot 2016-08-30 at 6 51 58 pm

But, if you have a restriction to enter D from A, the only possible route will be A to B, B to C and then C to E. This is where connectivity plays a major role in deciding the final route.

Road attributes / properties:

If A to C is a primary road which is crossing through a service road B to D and you want to travel from A to E, the navigation map comes up with the route traveling from A to B, B to C and then C to E and completely avoids A to B, B to D and then D to E because the travel on Primary road is much efficient than a narrow service road. This is how the attributes / properties with which the road is assigned with plays a crucial role in deciding the final route.

screen shot 2016-08-30 at 8 30 14 pm

OpenStreetMap data model:

The OpenStreetMap data model consists of nodes, ways, relations, and tags. A detailed description of the data model can be found in the The OpenStreetMap Data Model guide.

Navigation data is similarly a combination of nodes, ways, relations, and tags. Some of the examples are illustrated below:

Examples

  • Nodes:
  • Exit numbers:

screen shot 2016-08-30 at 5 20 44 pm

  • Ways:
    • Highway=*

screen shot 2016-08-30 at 6 17 55 pm

An way tagged with highway=secondary tag

  • Relations:
  • Turn restrictions are a combination of nodes, ways, tags, and relations. It consists of from way via node and to way, tied together by a restriction=* relation.

tr_relation

  • Tags: All the navigation features are differentiated and defined based on how they are tagged. Tags can be on any element: on nodes, ways, and relations.

Examples are: destination=*, ref=*, turn:lanes=*, restriction=*, etc.

Tracing roads

Before tracing, we need to inspect the start and endpoints of the road segment. We need to identify the road direction, general numbers of lanes and the places where there are extra lanes. Based on this we choose our strategy for tracing.

We are not able to draw a road on its center line, especially if roads join/fork or the number of lanes change. Imagine two roads which join: how would you draw the OSM-way around the point where the roads join?

center_line

Center line tracing

main_direction

Tracing based on road direction

Tracing roads with more than two lanes

There are two cases:

  • Dual carriageway roads

    dual_carriageway_road

These are bidirectional roads which have a physical separation between the lanes in both the directions. Both the ways will be counted for lanes and will be tagged with lanes=*. Dual carriageways are always oneway roads.

motorway Placement of nodes of the lines in each direction, opposite to each other

  • Roads which carry traffic in both directions (Bidirectional roads)

    bidirectional_road Road carrying traffic in both directions