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 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.

Road Features Mapping Guide

Mapping guides

Road Features Mapping Guide

Detailed guide mapping features for navigation on the OpenStreetMap project. Before you start, please read the guide on Mapping with OpenStreetMap

Query OpenStreetMap for Navigation Data via Overpass

Routing features

These are features that help the routing engine find the safest and fastest route between two points.

1. Functional Road Class

Roads are categorized according to its order of importance. They are tagged with the highway=*. The general order of importance for way types are:

highway= motorway > trunk > primary > secondary > ... > living streets > ... > footway

screen shot 2016-08-29 at 1 50 04 pm

highway=primary in San Francisco

The value of the key helps show the importance of the highway within the road network as a whole. The importance ranges from the most important motorway to the least important service. The routing engine takes into account this importance of classification when determining optimum routes.

Road classification may varies from country to country. The country specific use cases can be found in detail on separate wiki pages. For example, when mapping roads in India, the local community refer to the India road tagging wiki.


For an example of an area with a good concentration of different classes of roads on OpenStreetMap, look at San Francisco area. This osm query can be used to extract and gather numbers of all the highways present in a given bounding box on OpenStreetMap.

Department of Transportation websites and wikipedia are some of the primary sources for highway information.

2. Oneways

Oneways generally refer to road segments which allow traffic in only one direction. There are also streets which have oneway characteristics for only on certain times of the day to regulate traffic.

screen shot 2016-08-29 at 5 47 47 pm

oneway=yes shown in Mapillary

The best source of mapping oneways are again street level photos.

San Francisco is one area which has been well mapped for oneways in OpenStreetMap. This overpass query can be used to extract oneways from OpenStreetMap data.

3. Turn-Restrictions

type=restriction is added to a relation in OpenStreetMap which is used to describe turn restrictions at junctions. The relation has a set of tags that describes the type of restriction, for example. no_left_turn, no_right_turn, no_u_turn, etc. These are traffic signs at junctions and this information must be present on the map to find the best route by the routing engine while planning a route.

screen shot 2016-03-08 at 8 05 36 pm

Turn restriction denoting no left turn along with conditions: opening and closing times

The main resource for turn restriction data is street view level images, local mapping drives, DOT websites

turn_restriction turn restriction which denotes no right turn at the junction

San Francisco in OpenStreetMap has an excellent coverage of turn by turn restrictions at junctions. This overpass query can be used to extract current turn restriction in a bounding box.

4. Speed limits

  • maxspeed=60 or maxpseed=40 mph
  • OSM Wiki

The maxspeed=* tag defines the maximum legal speed limit for general traffic on a particular road, railway or waterway. The max speed values will be interpreted as kilometers per hour by default. The maxspeed=* is an important part of routing as it is used in determining the shortest time taken by a specific route to reach a destination. In the case of two routes, the one with the shortest time (higher maxspeed) and shortest distance will be considered as the optimum route.


Maxspeed sign shown in Mapillary

The main data sources for detecting maxspeed signs are: street view photos, wikipedia, DOT documents.

The maxspeed=* data on OpenStreetMap (for example, in London) in an area can be extracted by this overpass query.

5. Access-Restrictions

Apart from turn restrictions, there are access restrictions for different parts of highways. Some of these tags are access=no, access=private etc which will end up altering the route to be taken during the journey. For more information on the various kinds of access=* tags take a look at Key:access and Conditional restrictions and access restrictions


An access=no for non-motorized traffic, ends up altering the route for bicycle profiles, source: US MUTDC

All the access=private tags on OpenStreetMap ways, which will not allow that segment of the way to be used in a route can be extracted from this overpass query. An example of well-mapped access restrictions in OpenStreetMap can be found in London.

The sources for mapping access restrictions in OpenStreetMap are: street view photos, local mapping drives.

6. Traffic signals

Traffic signals such as: highway=traffic_signals, highway=stop or barrier=toll_booth as well as traffic_calming=* are considered during routing. The type=restriction more commonly referred to as turn restrictions are traffic signage which prohibits certain turns in intersections are also a crucial part of a great routing engine.

More details on mapping traffic signals for cars and pedestrians can be found in the OpenStreetMap wiki.

Street view photos from Mapillary, local mapping drives using OpenStreetMap tracker can be used as sources to map traffic signals in OpenStreetMap.


Traffic signal in a junction

Guidance features

1. Exit & destination signs

What are exit numbers?

  • An exit number is a number assigned to a road junction, usually an exit from a freeway. It is usually marked on the same sign as the destinations of the exit, as well as a sign in the gore.

Different tags for exit numbers:

  • ref=* is used when the exit has a specific number assigned to it.
  • noref=yes is used when the exit doesn’t have any official number assigned to it.

What are destination tags?

  • Destination tags describe the content of signposts or ground writing indicating the names of the locations that a certain exit from the freeway or a highway is heading to.
  • The key destination=* describes where a certain exit leads to. Thus navigation systems can refer to road signs that the driver actually sees.


Different tags for destinations:

  • destination tag refers to the place that the way exiting from the freeway leads to.
  • destination:ref is the reference of the roads directly ahead.
  • destination:ref:to is to specify the reference of a major highway ahead.
  • destination:street refers to the main street the way exiting from the freeway leads to.

An example of a place with good exit/destination coverage in OpenStreetMap is Ottawa, Canada. These overpass queries for destination and exit numbers can be used to extract exit/destination data from OpenStreetMap.

The detailed guide on adding exit and destination numbers can be followed for adding exit/destinations. This guide is specifically focused on North America (US/Canada) for now.

2. Turn Lanes

As discussed in Modeling Roads for navigation page, there are two types of roads: unidirectional and bidirectional. lanes=* tag is used to count the number of lanes in both these type of roads.

To set number of lanes for roads which carry traffic in both directions use :backward and :forward suffixes

Forward means the direction in which the way is drawn in OpenStreetMap, while backward means the opposite direction.


In the image below, the number of lanes is two - lanes=2. Orange line is the center line of bidirectional way which is the main way direction. When the extra lane starts in a bidirectional way, that segment is tagged as lanes=3+lanes:forward=2+lanes:backward=1. Optionally, we specify placement of the lanes relative to the way.


The below image have two tagging variants:

  1. lanes=2 - 1 lane for each direction, or
  2. lanes=3 - denote middle lane for left turn as (:point_left: this is discussed)


IN case the number of lanes is even but numbers of lanes for each direction not equal. :point_down:


Turn lanes have an influence on the path finding and are one of the most vital components for proper guidance. Choosing the correct turn lane can have a big influence in navigation. Oftentimes, they only help to illustrate a turn better but other times, they are vitally important. In guidance, the aim is to provide a set of instructions, like keep right or keep left by describing the optimum route found by the routing algorithm to a driver.

screen shot 2016-03-08 at 7 51 36 pm

How a driver views turn lanes from the car. For a single direction way, it will be tagged turn:lanes=left|left;through while for a bidirectional way it will be tagged turn:lanes:forward/turn:lanes:backward=left|left|through depending upon OpenStreetMap way direction

There are three turn lanes tags in OpenStreetMap:


Turn lanes can be mapped from high-resolution satellite imagery sources and street level photos. An example of the high density turn lane area in OpenStreetMap is Los Angeles. This overpass query can be used to extract turn lanes data from OpenStreetMap

Mapping guide for mapping turn lanes: This is a detailed mapping guide for adding turn lanes in general with specific focus on the US. It will be updated as more and more countries are mapped for lane information in OpenStreetMap.

The other important attributes in besides turn:lanes and exit/destination data required to provide the better guidance using OpenStreetMap data are:


Information for lanes, highway names, highway ref and relation:route can be found in their respective OpenStreetMap wikis.