Roads are the main map features that we use for rendering navigational applications. Accurate roads representation leads not only to the well-looking map but also to a more precise navigation.
For now, most common approach for road mapping is to trace roads following their centroid. This way of tracing looks good for 2-lanes roads like unclassified and residential roads or for tracing over low-res imagery.
A Way in OSM represents road as a complex feature. First of all, it is a line that represents an object (road), which covers a specific area on the ground. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See area:highway
=*
, description and comprehensive mapping guide in Wiki OSM)
To understand the complexity of a Way, the widht of the road in divided into absolute (meters) or in relative number of lanes units of measurement. Numbers of lanes on the road will help us to make our driving decisions. At least road has one lane for driving in both directions. This is a rough assumption. As a general rule, the road has two or more lanes for vehicular traffic.
Use the lanes=*
key to tag how many full-width traffic lanes there are on a highway.
There are two cases:
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.
Example:
highway=tertiary
lanes=5
lanes:forward=3
lanes:backward=2
Roads with an even number of lanes tend to have an equal number of lanes in each direction by default and thus we may omit :forward
and :backward
tagging.
In opposite case, when numbers of lanes for each directions don't match, we have to explicitly denote their numbers with lanes:forward=*
+lanes:backward=*
along with overall numbers of lanes=*
.
We are not aable 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 tracing
tracing main direction
Our decision is to trace main direction!
Before tracing (fix previous tracing), we need to inspect the strat and end points of the road segments. 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.
At the image below general number of lanes is two - lanes=2
. Orange line is the center line of bidirectional way which represents main movement direction. We don't change its flow when extra lanes are appeared. Just set lanes=3
+lanes:forward=2
+lanes:backward=1
tags for the segment at right low corner with extra lane for turn to right. Optionally we may specify placement of the lanes relatively to the our OSM-way.
Look to the below image. There is we have two tagging variants:
lanes=2
- 1 lane for each direction, orlanes=3
- denote middle lane for left turn as: point_left: this is discussed
highway=residential
lanes=3
lanes:forward=1
lanes:backward=1
lanes:both_ways=1
turn:lanes:both_ways=left
Case when number of lanes is even but numbers of lanes for each direction not equal.
Trace ways for dual carriageways road for each direction as close as possible to their outermost edge. There is some reasons for such way of tracing:
- In lower zoom levels we will be able to distinguish dual carriageways road from bidirectional one just glimpsing on the map
- GPS devices will associate their position with right road segments even in bad signal reception conditions
- Link roads which join to or fork from main highway will look good and will be connected in right places
- We are able to adjust position of the lanes on the road using
placement=right_of:3
tagging if needed.
Place nodes of the lines in each direction, opposite to each other, which will get a good view of the road on the map
A turn lane is an auxiliary lane demarcated on the road to specify directions to ongoing vehicles. Turn lanes serve two purposes:
- Provide directional information to the ongoing vehicles and
- Provide the lane information to be choosen for the vehicles changing their direction
There are a total of 12 different turn lanes demarcated on the roads. They are:
Turn Lane | Representation |
---|---|
left | |
right | |
through | |
left_through | |
right_through | |
left_through_right | |
left_right | |
slight_left | |
slight_right | |
merge_to_left | |
merge_to_right | |
bothways |
Before mapping turn lanes activate the following preferences in JOSM to visualize the mapped turn lanes: preferences > Map Settings
Map Paint Styles > Lane and road attributes
Tagging Presets > lane attributes
- Filter out non road features with inverse filter:
boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:
- Check all roads in the imagery for turn lanes at junction points
- Split the road into segments based on the total number of lanes for the segment
- For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg.
turn:lanes=left|left;through|through
. Check OSM turn:lanes for reference.
- For bi-directional segments, use
turn:lanes:backward=
andturn:lanes:forward=
to specify turn lanes in each direction.
- Verify correct tagging using the
Lane attributes
style
If there are no clear cut demarcations on the road and yet cars are parked on either sides of the road, consider them as drive lanes. Case below:
In the U.S., when parallel parking spaces are marked, they are marked in one of three ways:
Here’s an example of the box marking style:
Turn lanes should begin exactly as per the marking in the imagery, not before or after.
Turn lanes should terminate at the first highway junction after the start of the turn lane.
In case of bi-directional ways, the key turn:lanes:forward=* describes only the turning indications on the lanes in the same direction as the osm-way; while adding this we must view the road in the direction to the osm-way(on the direction where the osm-way arrow is pointing).
In case of bi-directional ways, the key turn:lanes:backward=* describes only the turning indications on the lanes in the opposite direction as the osm-way; while adding this we must view the road in the oppoiste direction to the osm-way(opposite to direction where the osm-way arrow is pointing).
*Adding a turn:lanes:backward
tag
HOV is a symbol demorcated on major roads generally used to indicate vehicle occupancy requirements.
In the above cases tag given to the road are hov:lanes=designated|yes|yes|yes
Road shoulders and bicycle lanes are ignored from the lane count. Both these roads are lanes=2
lanes=3 for the above example, ignoring the two cycle ways
- Ignore bicycle lanes even though they are in the middle;example below:
The middle way is also a biclcle lane which is not counted while adding the lanes
tag
- Additionally,
Strava global-heat cycle
layer can used to verify if a particular lane is a cycle-way.tms[16]:http://globalheat.strava.com/tiles/cycling/color3/{zoom}/{x}/{y}.png
Do not add turn lanes in these cases where the only turn lane is already a mapped as a separate way.
These are the lanes marked with symbol representing both directions at a time.
Tag used for such lanes are turn:lanes:both_ways=*
The imagery at some places is not very clear and at-times the turn-lanes are covered by cars. In situations like these Mapillary plugin
can be used. If there is Mapillary imagery coverage in that area, they can used to verify the presence of turn-lanes.
Name of the plugin: Mapillary