Skip to content

Instantly share code, notes, and snippets.

@Andygol
Forked from jothirnadh/mapping roads.md
Last active June 2, 2016 18:55
Show Gist options
  • Select an option

  • Save Andygol/43bfa16f38c27b8b9dfe to your computer and use it in GitHub Desktop.

Select an option

Save Andygol/43bfa16f38c27b8b9dfe to your computer and use it in GitHub Desktop.

Revisions

  1. Andygol revised this gist Feb 24, 2016. 1 changed file with 93 additions and 61 deletions.
    154 changes: 93 additions & 61 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,21 @@
    # Mapping roads for navigational purpose
    ## Roads:

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

    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)
    ![road_with_two_lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ### What is a Way

    ### What is a Way:
    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`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    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`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    ### What is a lane:
    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.
    ### What is a lane

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)
    To understand the complexity of a Way, the width of the road is 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.

    ![residential_road](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    Use the `lanes=*` key to tag how many full-width traffic lanes there are on a highway.

    @@ -21,11 +24,11 @@ Use the `lanes=*` key to tag how many full-width traffic lanes there are on a hi
    There are two cases:
    - Roads which carry traffic in both directions and

    ![simple road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)
    ![bidirectional_road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)

    - Dual carriageway roads.

    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)
    ![dual_carriageway_road](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

    To set number of lanes for roads which carry traffic in both directions use [`:backward` and `:forward` suffixes](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)

    @@ -43,13 +46,13 @@ Roads with an even number of lanes tend to have an equal number of lanes in each

    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?
    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](https://wiki.openstreetmap.org/w/images/4/47/Lane_Placement_2.png)
    ![center_line](https://wiki.openstreetmap.org/w/images/4/47/Lane_Placement_2.png)

    _center line tracing_

    ![main direction](https://wiki.openstreetmap.org/w/images/e/e4/Lane_Placement_3.png)
    ![main_direction](https://wiki.openstreetmap.org/w/images/e/e4/Lane_Placement_3.png)

    _tracing main direction_

    @@ -58,15 +61,16 @@ 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.

    ### Bidirectional roads

    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](https://wiki.openstreetmap.org/wiki/Proposed_features/placement) of the lanes relatively to the our OSM-way.

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)
    ![residential_road](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    ![image](https://cloud.githubusercontent.com/assets/369696/13228435/ae570094-d9a4-11e5-9f3c-4737112a7932.png)
    ![residential_road_2](https://cloud.githubusercontent.com/assets/369696/13228435/ae570094-d9a4-11e5-9f3c-4737112a7932.png)

    Look to the below image. There is we 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_
    2. `lanes=3` - denote middle lane for left turn as (:point_left: _this is discussed_)

    ```
    highway=residential
    @@ -76,29 +80,33 @@ lanes:backward=1
    lanes:both_ways=1
    turn:lanes:both_ways=left
    ```
    ![image](https://cloud.githubusercontent.com/assets/369696/13229045/ab01d6f0-d9a7-11e5-8d8a-1fe5518c84a5.png)
    ![residential_road_3](https://cloud.githubusercontent.com/assets/369696/13229045/ab01d6f0-d9a7-11e5-8d8a-1fe5518c84a5.png)

    Case when number of lanes is even but numbers of lanes for each direction not equal.
    ![image](https://cloud.githubusercontent.com/assets/369696/13229897/b09a811c-d9ab-11e5-935e-25906c94585b.png)
    Case when number of lanes is even but numbers of lanes for each direction not equal. :point_down:

    ![trunk_link](https://cloud.githubusercontent.com/assets/369696/13229897/b09a811c-d9ab-11e5-935e-25906c94585b.png)

    ### Dual carriageway roads

    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
    ![image](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)
    ![motorway](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)

    ## What is a turn lane

    ## What is a turn lane:
    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 directional information to the ongoing vehicles and
    * Provide the lane information to be choosen for the vehicles changing their direction

    ### Types of turn lanes
    There are a total of 12 different turn lanes demarcated on the roads. They are:

    There are a total of 12 different turn lanes demarcated on the roads. They are:

    Turn Lane | Representation
    --- | ---
    @@ -107,123 +115,147 @@ right | ![right](https://cloud.githubusercontent.com/assets/8401827/13217945/424
    through | ![through](https://cloud.githubusercontent.com/assets/8401827/13214156/f885d4b4-d973-11e5-9fb7-e9ecb70a932b.jpg)
    left_through | ![through left](https://cloud.githubusercontent.com/assets/8401827/13217986/80786072-d98c-11e5-99c6-db8665977550.png)
    right_through | ![through_right](https://cloud.githubusercontent.com/assets/8401827/13218022/b8aa9352-d98c-11e5-87c2-d8c17ee68305.jpg)
    left_through_right | ![leftthroughright](https://cloud.githubusercontent.com/assets/8401827/13218061/027e10ee-d98d-11e5-9747-c6867e0787b0.JPG)
    left_through_right | ![leftthroughright](https://cloud.githubusercontent.com/assets/8401827/13218061/027e10ee-d98d-11e5-9747-c6867e0787b0.JPG)
    left_right | ![left_right](https://cloud.githubusercontent.com/assets/8401827/13217579/8f833c66-d989-11e5-9b2c-dc98fdff09b2.png)
    slight_left | ![slightleft](https://cloud.githubusercontent.com/assets/8401827/13218207/e450feaa-d98d-11e5-938c-a3956de2f7ba.png)
    slight_right | ![slightright](https://cloud.githubusercontent.com/assets/8401827/13218219/07052b56-d98e-11e5-8fc0-82b945fb95c6.png)
    merge_to_left | ![merge to left](https://cloud.githubusercontent.com/assets/8401827/13218244/2ca1fd6c-d98e-11e5-8be9-cb64271f5991.png)
    merge_to_right | ![fahrbahn_2](https://cloud.githubusercontent.com/assets/8401827/13218183/bc5d0790-d98d-11e5-9781-307f80cc0732.png)
    bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/8401827/13217721/a2594d48-d98a-11e5-87f1-11e11ebf57ec.png)

    ### Pre-requirements for mapping a turn lane in JOSM:
    ![](http://pdd.ua/r/r/EEB7A996-D8DC-40FC-87EA-01F3E115BC7C/m_1.18_4.jpg)
    _road markings on the ground_ - © [pdd.ua](http://pdd.ua/ua/34/1.18/)

    ### Pre-requirements for mapping a turn lane in JOSM

    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`*

    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)
    ![lane_and_road_attributes](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

    * *`Tagging Presets > lane attributes`*

    ![taggingpresets22](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)
    ![tagging_presets](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)

    * Filter out non road features with inverse filter: `boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:`

    ### Mapping a turn lane

    * Check all roads in the imagery for turn lanes at junction points

    ![](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)
    ![roads_markings](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)

    * Split the road into segments based on the total number of lanes for the segment

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)
    ![residential_road](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    * 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](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.

    ![oneway_turnlane](https://cloud.githubusercontent.com/assets/8401827/13252110/a6bdea8a-da5a-11e5-8c79-aa15c0c15f68.gif)
    ![oneway_turn:lanes_tagging](https://cloud.githubusercontent.com/assets/8401827/13252110/a6bdea8a-da5a-11e5-8c79-aa15c0c15f68.gif)

    * For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)
    ![bidirectional_tagging](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)

    * Verify correct tagging using the `Lane attributes` style

    ![lane attributes](https://cloud.githubusercontent.com/assets/8401827/13251884/ddcbdd54-da58-11e5-86ae-c4a2918c9577.gif)
    ![lane_attributes](https://cloud.githubusercontent.com/assets/8401827/13251884/ddcbdd54-da58-11e5-86ae-c4a2918c9577.gif)

    ### `turn:lanes` and relations

    ### [Role of turn:lane in a relation](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507)
    We use [relations](http://wiki.openstreetmap.org/wiki/Relation) for different purpose – for indicating [turn restriction](http://wiki.openstreetmap.org/wiki/Relation:restriction) or collect separate ways into solid [route](http://wiki.openstreetmap.org/wiki/Relation:route).
    JOSM help us to handle them. But sometimes we are faced with not properly denoted relations. JOSM will inform about it while uploading our changes. You may [ignore messages of level "Warnings"](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507) (if you only split ways and didn't edit relations manually) but you have to fix all "Errors".

    ## Different scenarios we came across while mapping

    ### 1. Counting number of turn lanes:
    ### 1. Counting number of turn lanes

    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:

    ![screen shot 2016-02-18 at 5 10 10 pm](https://cloud.githubusercontent.com/assets/8401827/13142482/5b26d0a0-d663-11e5-90cd-4a65d75e7248.png)
    ![number_of_lanes](https://cloud.githubusercontent.com/assets/8401827/13142482/5b26d0a0-d663-11e5-90cd-4a65d75e7248.png)

    ### 2. Parking lane issue

    ### 2. Parking lane issue:
    In the U.S., when parallel parking spaces are marked, they are marked in one of [three ways](http://mutcd.fhwa.dot.gov/htm/2009/part3/fig3b_21_longdesc.htm):

    ![screen shot 2016-02-19 at 3 26 24 pm](https://cloud.githubusercontent.com/assets/8401827/13172245/326a7bb6-d71d-11e5-8617-a2516f75144b.png)
    ![parking_lanes](https://cloud.githubusercontent.com/assets/8401827/13172245/326a7bb6-d71d-11e5-8617-a2516f75144b.png)

    Here’s an example of the box marking style:

    [![boxes](https://upload.wikimedia.org/wikipedia/commons/thumb/0/03/J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG/320px-J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG)](https://commons.wikimedia.org/wiki/File:J.S._Shingler_Bldg_%28East_face%29,_McLendon_St,_Ashburn.JPG)

    ### 3. Starting a turn lane:
    [![boxes](https://upload.wikimedia.org/wikipedia/commons/thumb/0/03/J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG/320px-J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG)](https://commons.wikimedia.org/wiki/File:J.S._Shingler_Bldg_%28East_face%29,_McLendon_St,_Ashburn.JPG)

    ### 3. Starting a turn lane

    Turn lanes should begin exactly as per the marking in the imagery, not before or after.

    ![screen shot 2016-02-17 at 6 25 09 pm](https://cloud.githubusercontent.com/assets/8401827/13110125/0fe83ad0-d5a4-11e5-82ff-00245d0ba043.png)

    ### 4. Ending a turn lane:
    ![turn:lanes_start](https://cloud.githubusercontent.com/assets/8401827/13110125/0fe83ad0-d5a4-11e5-82ff-00245d0ba043.png)

    ### 4. Ending a turn lane

    Turn lanes should terminate at the first highway junction after the start of the turn lane.
    ![screen shot 2016-02-18 at 5 42 12 pm](https://cloud.githubusercontent.com/assets/8401827/13143057/4ff2b3c6-d667-11e5-8069-b028fabf7587.png)

    ![turn:lanes_end](https://cloud.githubusercontent.com/assets/8401827/13143057/4ff2b3c6-d667-11e5-8069-b028fabf7587.png)

    ### 5. Turn lane forward

    In case of bi-directional ways, the key [turn:lanes:forward=*](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right) 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**).

    ![turn f16](https://cloud.githubusercontent.com/assets/8401827/13175904/c5c922fc-d733-11e5-91b1-c0f9e5181fda.gif)
    ![turn:lanes:forward](https://cloud.githubusercontent.com/assets/8401827/13175904/c5c922fc-d733-11e5-91b1-c0f9e5181fda.gif)

    ### 6. Turn lane backward

    In case of bi-directional ways, the key [turn:lanes:backward=*](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right) 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**).

    ![turn backward14](https://cloud.githubusercontent.com/assets/13744156/13172709/859957c4-d71f-11e5-8cd9-ea154ad5d2e8.gif)
    *Adding a `turn:lanes:backward` tag
    ![turn:lanes:backward](https://cloud.githubusercontent.com/assets/13744156/13172709/859957c4-d71f-11e5-8cd9-ea154ad5d2e8.gif)

    *Adding a `turn:lanes:backward` tag*

    ### 7. How to add a HOV

    ### 7. [How to add a HOV](http://wiki.openstreetmap.org/wiki/Key:hov)
    HOV is a symbol demorcated on major roads generally used to indicate vehicle occupancy requirements.
    [HOV](http://wiki.openstreetmap.org/wiki/Key:hov) is a symbol demarcated on major roads generally used to indicate vehicle occupancy requirements.

    ![java openstreetmap editor 2016-01-25 20-35-24](https://cloud.githubusercontent.com/assets/369696/12560421/538d4af4-c3a3-11e5-9b6b-cb47f52f8f77.png)
    ![hov:lanes](https://cloud.githubusercontent.com/assets/369696/12560421/538d4af4-c3a3-11e5-9b6b-cb47f52f8f77.png)

    In the above cases tag given to the road are `hov:lanes=designated|yes|yes|yes`

    ### 8. Bicycle lanes and road shoulders:

    ### 8. Bicycle lanes and road shoulders

    Road shoulders and bicycle lanes are ignored from the lane count. Both these roads are `lanes=2`

    <img width="489" alt="screenshot 2015-12-10 17 35 07" src="https://cloud.githubusercontent.com/assets/126868/11715007/628dd90a-9f64-11e5-9e22-58614d2afbf6.png">
    ![bicycle+shoulders](https://cloud.githubusercontent.com/assets/126868/11715007/628dd90a-9f64-11e5-9e22-58614d2afbf6.png)

    ![bicycle_lanes](https://cloud.githubusercontent.com/assets/13744156/13172922/adc69f08-d720-11e5-8600-7a606d2e9bae.png)
    *lanes=3 for the above example, ignoring the two cycle ways*
    ![bicycle_lanes](https://cloud.githubusercontent.com/assets/13744156/13172922/adc69f08-d720-11e5-8600-7a606d2e9bae.png)

    *lanes=3 for the above example, ignoring the two cycle ways*

    * Ignore bicycle lanes even though they are in the middle;example below:

    ![68d49646-c3a4-11e5-807e-c7b118dd34bd](https://cloud.githubusercontent.com/assets/13744156/13173097/aaecd198-d721-11e5-8763-569e84b9b78e.png)
    ![omit_bicycle_lanes](https://cloud.githubusercontent.com/assets/13744156/13173097/aaecd198-d721-11e5-8763-569e84b9b78e.png)

    *The middle way is also a biclcle lane which is not counted while adding the `lanes` tag*
    *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`

    ### 9. Lane marked as a separate way

    Do not add turn lanes in these cases where the only turn lane is already a mapped as a separate way.

    <img width="348" alt="9e4a470a-9f62-11e5-83ac-920ac6181842" src="https://cloud.githubusercontent.com/assets/13744156/13173428/6694c468-d723-11e5-96be-b95502b9f58a.png">
    ![lane_as_separate_way](https://cloud.githubusercontent.com/assets/13744156/13173428/6694c468-d723-11e5-96be-b95502b9f58a.png)

    ### 10. Bidirectional turn lanes

    ### 10. Bidirectional turn lanes:
    These are the lanes marked with symbol representing both directions at a time.
    ![screen shot 2016-01-28 at 4 47 52 pm](https://cloud.githubusercontent.com/assets/8401827/12642951/0162ff9c-c5df-11e5-8a14-a41f263ae086.png)

    ![turn:lanes:both_ways](https://cloud.githubusercontent.com/assets/8401827/12642951/0162ff9c-c5df-11e5-8a14-a41f263ae086.png)

    Tag used for such lanes are `turn:lanes:both_ways=*`

    ### 11. Mapillary Plugin to verify turn lanes:
    ### 11. Mapillary Plugin to verify turn lanes

    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

    ![turnlanes_mapillary](https://cloud.githubusercontent.com/assets/4470913/12884912/6b405d1e-ce87-11e5-8d0f-cd8a8a8b3dfd.gif)
    ![turnlanes_mapillary](https://cloud.githubusercontent.com/assets/4470913/12884912/6b405d1e-ce87-11e5-8d0f-cd8a8a8b3dfd.gif)
  2. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -150,8 +150,6 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz

    ### [Role of turn:lane in a relation](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507)

    ### Difference between a turn:lane and a turn: restruction

    ## Different scenarios we came across while mapping

    ### 1. Counting number of turn lanes:
  3. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -12,6 +12,8 @@ A Way in OSM represents road as a complex feature. First of all, it is a line th
    ### What is a lane:
    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.

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    Use the `lanes=*` key to tag how many full-width traffic lanes there are on a highway.

    #### Roads with more than two lanes
  4. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -7,10 +7,12 @@ For now, most common approach for road mapping is to trace roads following their
    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ### What is a Way:
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of **lanes**) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    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`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    ### What is a lane:
    To understand the complexity of the Way, the widht of the road in divided into A way is Use the lanes=* key to tag how many full-width traffic lanes there are on a highway.
    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.

    #### Roads with more than two lanes

  5. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Mapping roads for navigation
    # Mapping roads for navigational purpose
    ## Roads:
    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.

    @@ -7,9 +7,10 @@ For now, most common approach for road mapping is to trace roads following their
    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ### What is a Way:
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of **lanes**) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    ### What is a lane:
    To understand the complexity of the Way, the widht of the road in divided into A way is Use the lanes=* key to tag how many full-width traffic lanes there are on a highway.

    #### Roads with more than two lanes

  6. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -131,7 +131,9 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    * For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.
    * 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](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.

    ![oneway_turnlane](https://cloud.githubusercontent.com/assets/8401827/13252110/a6bdea8a-da5a-11e5-8c79-aa15c0c15f68.gif)

    * For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

  7. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -123,21 +123,21 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz
    * Filter out non road features with inverse filter: `boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:`

    ### Mapping a turn lane
    1. Check all roads in the imagery for turn lanes at junction points
    * Check all roads in the imagery for turn lanes at junction points

    ![](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)

    2. Split the road into segments based on the total number of lanes for the segment
    * Split the road into segments based on the total number of lanes for the segment

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    3. For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.
    * For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.

    4. For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.
    * For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)

    5. Verify correct tagging using the `Lane attributes` style
    * Verify correct tagging using the `Lane attributes` style

    ![lane attributes](https://cloud.githubusercontent.com/assets/8401827/13251884/ddcbdd54-da58-11e5-86ae-c4a2918c9577.gif)

  8. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -123,23 +123,23 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz
    * Filter out non road features with inverse filter: `boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:`

    ### Mapping a turn lane
    - Check all roads in the imagery for turn lanes at junction points
    1. Check all roads in the imagery for turn lanes at junction points

    ![](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)

    - Split the road into segments based on the total number of lanes for the segment
    2. Split the road into segments based on the total number of lanes for the segment

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    - For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.
    3. For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.

    - For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.
    4. For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)

    - Verify correct tagging using the `Lane attributes` style
    5. Verify correct tagging using the `Lane attributes` style

    ![](https://cloud.githubusercontent.com/assets/126868/11713668/d3f6d498-9f5a-11e5-91ea-5d9ab5714b39.png)
    ![lane attributes](https://cloud.githubusercontent.com/assets/8401827/13251884/ddcbdd54-da58-11e5-86ae-c4a2918c9577.gif)

    ### [Role of turn:lane in a relation](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507)

  9. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 5 additions and 11 deletions.
    16 changes: 5 additions & 11 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -112,11 +112,11 @@ bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/84

    ### Pre-requirements for mapping a turn lane in JOSM:
    Before mapping turn lanes activate the following preferences in JOSM to visualize the mapped turn lanes: `preferences > Map Settings`
    * *`Map Paint Styles > Lanes and road attributes`*
    * *`Map Paint Styles > Lane and road attributes`*

    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

    * `*Tagging Presets > lane attributes*`
    * *`Tagging Presets > lane attributes`*

    ![taggingpresets22](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)

    @@ -132,21 +132,15 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz
    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    - For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.

    - For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)

    - Verify correct tagging using the `Lane attributes` style

    ![](https://cloud.githubusercontent.com/assets/126868/11713668/d3f6d498-9f5a-11e5-91ea-5d9ab5714b39.png)

    **There are generally two different scenarios in mapping turn lanes:**

    * Mapping turn lanes(oneway):

    * Mapping turn lanes (bi-directional ways)

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)


    ### [Role of turn:lane in a relation](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507)

    ### Difference between a turn:lane and a turn: restruction
  10. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -112,7 +112,7 @@ bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/84

    ### Pre-requirements for mapping a turn lane in JOSM:
    Before mapping turn lanes activate the following preferences in JOSM to visualize the mapped turn lanes: `preferences > Map Settings`
    * `*Map Paint Styles > Lanes and road attributes*`
    * *`Map Paint Styles > Lanes and road attributes`*

    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

  11. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -112,11 +112,11 @@ bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/84

    ### Pre-requirements for mapping a turn lane in JOSM:
    Before mapping turn lanes activate the following preferences in JOSM to visualize the mapped turn lanes: `preferences > Map Settings`
    * **Map Paint Styles > Lanes and road attributes**
    * `*Map Paint Styles > Lanes and road attributes*`

    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

    * **Tagging Presets > lane attributes**
    * `*Tagging Presets > lane attributes*`

    ![taggingpresets22](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)

  12. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -129,9 +129,13 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz

    - 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|through|right`. See [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes)
    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    - For each road segment tag the turn lanes based on the road markings in the direction of the way. Eg. `turn:lanes=left|through|right`. Check [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes) for reference.
    - For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.

    - Verify correct tagging using the `Lane attributes` style

    ![](https://cloud.githubusercontent.com/assets/126868/11713668/d3f6d498-9f5a-11e5-91ea-5d9ab5714b39.png)

    **There are generally two different scenarios in mapping turn lanes:**
  13. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -117,14 +117,18 @@ Before mapping turn lanes activate the following preferences in JOSM to visualiz
    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

    * **Tagging Presets > lane attributes**

    ![taggingpresets22](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)

    * Filter out non road features with inverse filter: `boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:`

    ### Mapping a turn lane
    - Check all roads in the imagery for turn lanes at junction points

    ![](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)

    - 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|through|right`. See [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes)
    - For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.
    - Verify correct tagging using the `Lane attributes` style
  14. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 116 additions and 9 deletions.
    125 changes: 116 additions & 9 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    # Mapping roads accurately
    ### Roads:
    # Mapping roads for navigation
    ## Roads:
    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.
    @@ -9,13 +9,9 @@ For now, most common approach for road mapping is to trace roads following their
    ### What is a Way:
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    General road tracing is easy - trace roads by its middle axis.

    In our everyday life we comeacross with different types of road designs. How we have to trace it?

    ### What is a lane:

    ## Roads with more than two lanes
    #### Roads with more than two lanes

    There are two cases:
    - Roads which carry traffic in both directions and
    @@ -80,7 +76,7 @@ turn:lanes:both_ways=left
    Case when number of lanes is even but numbers of lanes for each direction not equal.
    ![image](https://cloud.githubusercontent.com/assets/369696/13229897/b09a811c-d9ab-11e5-935e-25906c94585b.png)

    ### Dual carriageways roads
    ### Dual carriageway roads
    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
    @@ -90,7 +86,7 @@ Trace ways for dual carriageways road for each direction as close as possible to
    Place nodes of the lines in each direction, opposite to each other, which will get a good view of the road on the map
    ![image](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)

    ### What is a turn lane:
    ## What is a turn lane:
    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
    @@ -113,3 +109,114 @@ slight_right | ![slightright](https://cloud.githubusercontent.com/assets/8401827
    merge_to_left | ![merge to left](https://cloud.githubusercontent.com/assets/8401827/13218244/2ca1fd6c-d98e-11e5-8be9-cb64271f5991.png)
    merge_to_right | ![fahrbahn_2](https://cloud.githubusercontent.com/assets/8401827/13218183/bc5d0790-d98d-11e5-9781-307f80cc0732.png)
    bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/8401827/13217721/a2594d48-d98a-11e5-87f1-11e11ebf57ec.png)

    ### Pre-requirements for mapping a turn lane in JOSM:
    Before mapping turn lanes activate the following preferences in JOSM to visualize the mapped turn lanes: `preferences > Map Settings`
    * **Map Paint Styles > Lanes and road attributes**

    ![lane and road attributes5](https://cloud.githubusercontent.com/assets/13744156/13218788/c55fab96-d991-11e5-89b2-b281986d704e.gif)

    * **Tagging Presets > lane attributes**
    ![taggingpresets22](https://cloud.githubusercontent.com/assets/13744156/13218902/ad15c902-d992-11e5-872b-1bde24f27f5b.gif)

    * Filter out non road features with inverse filter: `boundary: | leisure: | landuse: | waterway: | amenity: | natural: | building:`

    ### Mapping a turn lane
    - Check all roads in the imagery for turn lanes at junction points
    ![](https://cloud.githubusercontent.com/assets/126868/11710074/b58b52e4-9f42-11e5-971a-000a699a0b6d.png)
    - 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|through|right`. See [OSM turn:lanes](http://wiki.openstreetmap.org/wiki/Key:turn:lanes)
    - For bi-directional segments, use `turn:lanes:backward=` and `turn:lanes:forward=` to specify turn lanes in each direction.
    - Verify correct tagging using the `Lane attributes` style
    ![](https://cloud.githubusercontent.com/assets/126868/11713668/d3f6d498-9f5a-11e5-91ea-5d9ab5714b39.png)

    **There are generally two different scenarios in mapping turn lanes:**

    * Mapping turn lanes(oneway):

    * Mapping turn lanes (bi-directional ways)

    ![biirectional29](https://cloud.githubusercontent.com/assets/13744156/13219545/acd78f62-d996-11e5-85eb-3e05a7b79d3b.gif)


    ### [Role of turn:lane in a relation](https://github.com/mapbox/mapping/issues/153#issuecomment-185679507)

    ### Difference between a turn:lane and a turn: restruction

    ## Different scenarios we came across while mapping

    ### 1. Counting number of turn lanes:
    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:

    ![screen shot 2016-02-18 at 5 10 10 pm](https://cloud.githubusercontent.com/assets/8401827/13142482/5b26d0a0-d663-11e5-90cd-4a65d75e7248.png)

    ### 2. Parking lane issue:
    In the U.S., when parallel parking spaces are marked, they are marked in one of [three ways](http://mutcd.fhwa.dot.gov/htm/2009/part3/fig3b_21_longdesc.htm):

    ![screen shot 2016-02-19 at 3 26 24 pm](https://cloud.githubusercontent.com/assets/8401827/13172245/326a7bb6-d71d-11e5-8617-a2516f75144b.png)

    Here’s an example of the box marking style:

    [![boxes](https://upload.wikimedia.org/wikipedia/commons/thumb/0/03/J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG/320px-J.S._Shingler_Bldg_%28East_face%29%2C_McLendon_St%2C_Ashburn.JPG)](https://commons.wikimedia.org/wiki/File:J.S._Shingler_Bldg_%28East_face%29,_McLendon_St,_Ashburn.JPG)

    ### 3. Starting a turn lane:
    Turn lanes should begin exactly as per the marking in the imagery, not before or after.

    ![screen shot 2016-02-17 at 6 25 09 pm](https://cloud.githubusercontent.com/assets/8401827/13110125/0fe83ad0-d5a4-11e5-82ff-00245d0ba043.png)

    ### 4. Ending a turn lane:
    Turn lanes should terminate at the first highway junction after the start of the turn lane.
    ![screen shot 2016-02-18 at 5 42 12 pm](https://cloud.githubusercontent.com/assets/8401827/13143057/4ff2b3c6-d667-11e5-8069-b028fabf7587.png)

    ### 5. Turn lane forward
    In case of bi-directional ways, the key [turn:lanes:forward=*](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right) 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**).

    ![turn f16](https://cloud.githubusercontent.com/assets/8401827/13175904/c5c922fc-d733-11e5-91b1-c0f9e5181fda.gif)

    ### 6. Turn lane backward
    In case of bi-directional ways, the key [turn:lanes:backward=*](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right) 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**).

    ![turn backward14](https://cloud.githubusercontent.com/assets/13744156/13172709/859957c4-d71f-11e5-8cd9-ea154ad5d2e8.gif)
    *Adding a `turn:lanes:backward` tag

    ### 7. [How to add a HOV](http://wiki.openstreetmap.org/wiki/Key:hov)
    HOV is a symbol demorcated on major roads generally used to indicate vehicle occupancy requirements.

    ![java openstreetmap editor 2016-01-25 20-35-24](https://cloud.githubusercontent.com/assets/369696/12560421/538d4af4-c3a3-11e5-9b6b-cb47f52f8f77.png)

    In the above cases tag given to the road are `hov:lanes=designated|yes|yes|yes`

    ### 8. Bicycle lanes and road shoulders:
    Road shoulders and bicycle lanes are ignored from the lane count. Both these roads are `lanes=2`

    <img width="489" alt="screenshot 2015-12-10 17 35 07" src="https://cloud.githubusercontent.com/assets/126868/11715007/628dd90a-9f64-11e5-9e22-58614d2afbf6.png">

    ![bicycle_lanes](https://cloud.githubusercontent.com/assets/13744156/13172922/adc69f08-d720-11e5-8600-7a606d2e9bae.png)
    *lanes=3 for the above example, ignoring the two cycle ways*

    * Ignore bicycle lanes even though they are in the middle;example below:

    ![68d49646-c3a4-11e5-807e-c7b118dd34bd](https://cloud.githubusercontent.com/assets/13744156/13173097/aaecd198-d721-11e5-8763-569e84b9b78e.png)

    *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`

    ### 9. Lane marked as a separate way
    Do not add turn lanes in these cases where the only turn lane is already a mapped as a separate way.

    <img width="348" alt="9e4a470a-9f62-11e5-83ac-920ac6181842" src="https://cloud.githubusercontent.com/assets/13744156/13173428/6694c468-d723-11e5-96be-b95502b9f58a.png">

    ### 10. Bidirectional turn lanes:
    These are the lanes marked with symbol representing both directions at a time.
    ![screen shot 2016-01-28 at 4 47 52 pm](https://cloud.githubusercontent.com/assets/8401827/12642951/0162ff9c-c5df-11e5-8a14-a41f263ae086.png)

    Tag used for such lanes are `turn:lanes:both_ways=*`

    ### 11. Mapillary Plugin to verify turn lanes:
    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

    ![turnlanes_mapillary](https://cloud.githubusercontent.com/assets/4470913/12884912/6b405d1e-ce87-11e5-8d0f-cd8a8a8b3dfd.gif)
  15. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 25 additions and 23 deletions.
    48 changes: 25 additions & 23 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -13,29 +13,7 @@ General road tracing is easy - trace roads by its middle axis.

    In our everyday life we comeacross with different types of road designs. How we have to trace it?

    ### What is a turn lane:
    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

    ### Types of turn lanes
    There are a total of 12 different turn lanes demarcated on the roads. They are:

    Turn Lane | Representation
    --- | ---
    left | ![left](https://cloud.githubusercontent.com/assets/8401827/13217928/1d2fc24e-d98c-11e5-9d20-c526fe6e7f01.jpg)
    right | ![right](https://cloud.githubusercontent.com/assets/8401827/13217945/424f36e0-d98c-11e5-99e7-9d178f2529a1.jpg)
    through | ![through](https://cloud.githubusercontent.com/assets/8401827/13214156/f885d4b4-d973-11e5-9fb7-e9ecb70a932b.jpg)
    left_through | ![through left](https://cloud.githubusercontent.com/assets/8401827/13217986/80786072-d98c-11e5-99c6-db8665977550.png)
    right_through | ![through_right](https://cloud.githubusercontent.com/assets/8401827/13218022/b8aa9352-d98c-11e5-87c2-d8c17ee68305.jpg)
    left_through_right | ![leftthroughright](https://cloud.githubusercontent.com/assets/8401827/13218061/027e10ee-d98d-11e5-9747-c6867e0787b0.JPG)
    left_right | ![left_right](https://cloud.githubusercontent.com/assets/8401827/13217579/8f833c66-d989-11e5-9b2c-dc98fdff09b2.png)
    slight_left | ![slightleft](https://cloud.githubusercontent.com/assets/8401827/13218207/e450feaa-d98d-11e5-938c-a3956de2f7ba.png)
    slight_right | ![slightright](https://cloud.githubusercontent.com/assets/8401827/13218219/07052b56-d98e-11e5-8fc0-82b945fb95c6.png)
    merge_to_left | ![merge to left](https://cloud.githubusercontent.com/assets/8401827/13218244/2ca1fd6c-d98e-11e5-8be9-cb64271f5991.png)
    merge_to_right | ![fahrbahn_2](https://cloud.githubusercontent.com/assets/8401827/13218183/bc5d0790-d98d-11e5-9781-307f80cc0732.png)
    bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/8401827/13217721/a2594d48-d98a-11e5-87f1-11e11ebf57ec.png)
    ### What is a lane:

    ## Roads with more than two lanes

    @@ -111,3 +89,27 @@ Trace ways for dual carriageways road for each direction as close as possible to

    Place nodes of the lines in each direction, opposite to each other, which will get a good view of the road on the map
    ![image](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)

    ### What is a turn lane:
    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

    ### Types of turn lanes
    There are a total of 12 different turn lanes demarcated on the roads. They are:

    Turn Lane | Representation
    --- | ---
    left | ![left](https://cloud.githubusercontent.com/assets/8401827/13217928/1d2fc24e-d98c-11e5-9d20-c526fe6e7f01.jpg)
    right | ![right](https://cloud.githubusercontent.com/assets/8401827/13217945/424f36e0-d98c-11e5-99e7-9d178f2529a1.jpg)
    through | ![through](https://cloud.githubusercontent.com/assets/8401827/13214156/f885d4b4-d973-11e5-9fb7-e9ecb70a932b.jpg)
    left_through | ![through left](https://cloud.githubusercontent.com/assets/8401827/13217986/80786072-d98c-11e5-99c6-db8665977550.png)
    right_through | ![through_right](https://cloud.githubusercontent.com/assets/8401827/13218022/b8aa9352-d98c-11e5-87c2-d8c17ee68305.jpg)
    left_through_right | ![leftthroughright](https://cloud.githubusercontent.com/assets/8401827/13218061/027e10ee-d98d-11e5-9747-c6867e0787b0.JPG)
    left_right | ![left_right](https://cloud.githubusercontent.com/assets/8401827/13217579/8f833c66-d989-11e5-9b2c-dc98fdff09b2.png)
    slight_left | ![slightleft](https://cloud.githubusercontent.com/assets/8401827/13218207/e450feaa-d98d-11e5-938c-a3956de2f7ba.png)
    slight_right | ![slightright](https://cloud.githubusercontent.com/assets/8401827/13218219/07052b56-d98e-11e5-8fc0-82b945fb95c6.png)
    merge_to_left | ![merge to left](https://cloud.githubusercontent.com/assets/8401827/13218244/2ca1fd6c-d98e-11e5-8be9-cb64271f5991.png)
    merge_to_right | ![fahrbahn_2](https://cloud.githubusercontent.com/assets/8401827/13218183/bc5d0790-d98d-11e5-9781-307f80cc0732.png)
    bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/8401827/13217721/a2594d48-d98a-11e5-87f1-11e11ebf57ec.png)
  16. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -19,8 +19,8 @@ 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

    ### Types of turn:lane
    There are a total of 12 different types of turn lanes demarcated on the roads. They are:
    ### Types of turn lanes
    There are a total of 12 different turn lanes demarcated on the roads. They are:

    Turn Lane | Representation
    --- | ---
  17. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 30 additions and 6 deletions.
    36 changes: 30 additions & 6 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -13,6 +13,30 @@ General road tracing is easy - trace roads by its middle axis.

    In our everyday life we comeacross with different types of road designs. How we have to trace it?

    ### What is a turn lane:
    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

    ### Types of turn:lane
    There are a total of 12 different types of turn lanes demarcated on the roads. They are:

    Turn Lane | Representation
    --- | ---
    left | ![left](https://cloud.githubusercontent.com/assets/8401827/13217928/1d2fc24e-d98c-11e5-9d20-c526fe6e7f01.jpg)
    right | ![right](https://cloud.githubusercontent.com/assets/8401827/13217945/424f36e0-d98c-11e5-99e7-9d178f2529a1.jpg)
    through | ![through](https://cloud.githubusercontent.com/assets/8401827/13214156/f885d4b4-d973-11e5-9fb7-e9ecb70a932b.jpg)
    left_through | ![through left](https://cloud.githubusercontent.com/assets/8401827/13217986/80786072-d98c-11e5-99c6-db8665977550.png)
    right_through | ![through_right](https://cloud.githubusercontent.com/assets/8401827/13218022/b8aa9352-d98c-11e5-87c2-d8c17ee68305.jpg)
    left_through_right | ![leftthroughright](https://cloud.githubusercontent.com/assets/8401827/13218061/027e10ee-d98d-11e5-9747-c6867e0787b0.JPG)
    left_right | ![left_right](https://cloud.githubusercontent.com/assets/8401827/13217579/8f833c66-d989-11e5-9b2c-dc98fdff09b2.png)
    slight_left | ![slightleft](https://cloud.githubusercontent.com/assets/8401827/13218207/e450feaa-d98d-11e5-938c-a3956de2f7ba.png)
    slight_right | ![slightright](https://cloud.githubusercontent.com/assets/8401827/13218219/07052b56-d98e-11e5-8fc0-82b945fb95c6.png)
    merge_to_left | ![merge to left](https://cloud.githubusercontent.com/assets/8401827/13218244/2ca1fd6c-d98e-11e5-8be9-cb64271f5991.png)
    merge_to_right | ![fahrbahn_2](https://cloud.githubusercontent.com/assets/8401827/13218183/bc5d0790-d98d-11e5-9781-307f80cc0732.png)
    bothways | ![turn lanes both ways](https://cloud.githubusercontent.com/assets/8401827/13217721/a2594d48-d98a-11e5-87f1-11e11ebf57ec.png)

    ## Roads with more than two lanes

    There are two cases:
    @@ -55,15 +79,15 @@ 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.

    ### Bidirectional roads
    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` for the segment at right low corner with extra lane for turn to right. Optionally we may specify [placement](https://wiki.openstreetmap.org/wiki/Proposed_features/placement) of the lanes relatively to the our OSM-way.
    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](https://wiki.openstreetmap.org/wiki/Proposed_features/placement) of the lanes relatively to the our OSM-way.

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    ![image](https://cloud.githubusercontent.com/assets/369696/13228435/ae570094-d9a4-11e5-9f3c-4737112a7932.png)

    Look to the below image. There is we 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_
    2. `lanes=3` - denote middle lane for left turn as: point_left: _this is discussed_

    ```
    highway=residential
    @@ -80,10 +104,10 @@ turn:lanes:both_ways=left

    ### Dual carriageways roads
    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
    - 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.
    - 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
    Place nodes of the lines in each direction, opposite to each other, which will get a good view of the road on the map
    ![image](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)
  18. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ Roads with an even number of lanes tend to have an equal number of lanes in each

    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 aren't be able always to draw a road on its center line, especially if roads join/fork or the number of lanes changes. Imagine two roads which join: how would you draw the OSM-way around the point where the roads join?
    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](https://wiki.openstreetmap.org/w/images/4/47/Lane_Placement_2.png)

    @@ -52,7 +52,7 @@ We aren't be able always to draw a road on its center line, especially if roads

    Our decision is to trace **main direction**!

    Before tracing (fix previous tracing), we need to inspect segments of the road before and after in some distance from selected place. We need to decide how to flow main direction of the road, general numbers of lanes and the places where there are extra lanes. Based on this we choose our strategy.
    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.

    ### Bidirectional roads
    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` for the segment at right low corner with extra lane for turn to right. Optionally we may specify [placement](https://wiki.openstreetmap.org/wiki/Proposed_features/placement) of the lanes relatively to the our OSM-way.
  19. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -29,11 +29,11 @@ To set number of lanes for roads which carry traffic in both directions use [`:b
    `Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.

    ``` xml
    *Example:*
    highway=tertiary
    lanes=5
    lanes:forward=3
    lanes:backward=2
    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.
  20. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,7 @@ To set number of lanes for roads which carry traffic in both directions use [`:b
    `Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.

    ``` xml
    *Example:*
    highway=tertiary
    lanes=5
    lanes:forward=3
  21. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -16,11 +16,11 @@ In our everyday life we comeacross with different types of road designs. How we
    ## Roads with more than two lanes

    There are two cases:
    - Roads which carry traffic in both directions and
    - Roads which carry traffic in both directions and

    ![simple road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)

    - Dual carriageway roads.
    - Dual carriageway roads.

    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

  22. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -25,7 +25,8 @@ There are two cases:
    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

    To set number of lanes for roads which carry traffic in both directions use [`:backward` and `:forward` suffixes](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)
    >`Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.

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

    ``` xml
    highway=tertiary
  23. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ For now, most common approach for road mapping is to trace roads following their

    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ## What is a Way:
    ### What is a Way:
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    General road tracing is easy - trace roads by its middle axis.
    @@ -15,16 +15,16 @@ In our everyday life we comeacross with different types of road designs. How we

    ## Roads with more than two lanes

    There is two cases:
    There are two cases:
    - Roads which carry traffic in both directions and

    ![simple road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)

    - Dual carriageways roads.
    - Dual carriageway roads.

    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

    To set number of lanes for roads which carry traffic in both directions use `:backward` and `:forward` suffixes - [http://wiki.openstreetmap.org/wiki/Forward_&_backward,_left_&_right#Forward_and_backward](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)
    To set number of lanes for roads which carry traffic in both directions use [`:backward` and `:forward` suffixes](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)
    >`Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.
    ``` xml
  24. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ There is two cases:

    To set number of lanes for roads which carry traffic in both directions use `:backward` and `:forward` suffixes - [http://wiki.openstreetmap.org/wiki/Forward_&_backward,_left_&_right#Forward_and_backward](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)
    >`Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.
    >
    ``` xml
    highway=tertiary
    lanes=5
  25. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,17 @@
    # Mapping roads accurately
    ### Roads
    ### Roads:
    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.

    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ## What a way is
    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. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    ## What is a Way:
    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. To show this, we can specify the width of the road in absolute (meters) or in relative (number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)

    General road tracing is easy - trace roads by its middle axis.

    In our everyday life we faced with different cases of shape of roads. How we have to trace it?

    In our everyday life we comeacross with different types of road designs. How we have to trace it?

    ## Roads with more than two lanes

  26. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,6 @@ For now, most common approach for road mapping is to trace roads following their
    ## What a way is
    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. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)


    General road tracing is easy - trace roads by its middle axis.

    In our everyday life we faced with different cases of shape of roads. How we have to trace it?
    @@ -18,11 +17,11 @@ In our everyday life we faced with different cases of shape of roads. How we ha
    ## Roads with more than two lanes

    There is two cases:
    - roads which carry traffic in both directions and
    - Roads which carry traffic in both directions and

    ![simple road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)

    - dual carriageways roads.
    - Dual carriageways roads.

    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

  27. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,13 @@
    # Mapping roads accurately
    ### Roads
    Roads are the main map features that we use in rendering navigation. Accurate roads representation leads not only to the well-looking map but also a more precise navigation.
    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.

    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ## What a way is
    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. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    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. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)


    General road tracing is easy - trace roads by its middle axis.
  28. @jothirnadh jothirnadh revised this gist Feb 23, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ For now, most common approach for road mapping is to trace roads following their
    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ## What a way is
    A Way in OSM represents road as a complex feature. First of all, it is a line that represents the object (road) which covers a specific **area** on the ground. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)
    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. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)


    General road tracing is easy - trace roads by its middle axis.
  29. @jothirnadh jothirnadh created this gist Feb 23, 2016.
    88 changes: 88 additions & 0 deletions mapping roads.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,88 @@
    ### Roads
    Roads are the main map features that we use in rendering navigation. Accurate roads representation leads not only to the well-looking map but also 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.

    ![road with two lanes](https://cloud.githubusercontent.com/assets/369696/13230189/1bc4b308-d9ad-11e5-88b7-f85fcd290926.png)

    ## What a way is
    A Way in OSM represents road as a complex feature. First of all, it is a line that represents the object (road) which covers a specific **area** on the ground. To show this, we can specify the width of the road in absolute(meters) or in relative(number of lanes) units of measurement. Numbers of lanes on the road will help us to make our driving decision. At least road has 1 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. In order to show the shape and contours of the road we may to draw a polygon and mark it accordingly. (See [`area:highway`=`*`](http://wiki.openstreetmap.org/wiki/Key:area:highway), [description](http://wiki.openstreetmap.org/wiki/Proposed_features/Street_area) and [comprehensive mapping guide](http://wiki.openstreetmap.org/wiki/Proposed_features/area_highway/mapping_guidelines) in Wiki OSM)


    General road tracing is easy - trace roads by its middle axis.

    In our everyday life we faced with different cases of shape of roads. How we have to trace it?


    ## Roads with more than two lanes

    There is two cases:
    - roads which carry traffic in both directions and

    ![simple road](https://cloud.githubusercontent.com/assets/369696/13230341/9f9db6c0-d9ad-11e5-9f5d-53dd80b40f67.png)

    - dual carriageways roads.

    ![dual carriageways](https://cloud.githubusercontent.com/assets/369696/13230427/fe21579c-d9ad-11e5-86ba-38107d469c54.png)

    To set number of lanes for roads which carry traffic in both directions use `:backward` and `:forward` suffixes - [http://wiki.openstreetmap.org/wiki/Forward_&_backward,_left_&_right#Forward_and_backward](http://wiki.openstreetmap.org/wiki/Forward_%26_backward,_left_%26_right#Forward_and_backward)
    >`Forward` means the direction in which the way is drawn in OpenStreetMap, while `backward` means the opposite direction.
    >
    ``` xml
    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 aren't be able always to draw a road on its center line, especially if roads join/fork or the number of lanes changes. Imagine two roads which join: how would you draw the OSM-way around the point where the roads join?

    ![center line](https://wiki.openstreetmap.org/w/images/4/47/Lane_Placement_2.png)

    _center line tracing_

    ![main direction](https://wiki.openstreetmap.org/w/images/e/e4/Lane_Placement_3.png)

    _tracing main direction_

    Our decision is to trace **main direction**!

    Before tracing (fix previous tracing), we need to inspect segments of the road before and after in some distance from selected place. We need to decide how to flow main direction of the road, general numbers of lanes and the places where there are extra lanes. Based on this we choose our strategy.

    ### Bidirectional roads
    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` for the segment at right low corner with extra lane for turn to right. Optionally we may specify [placement](https://wiki.openstreetmap.org/wiki/Proposed_features/placement) of the lanes relatively to the our OSM-way.

    ![](https://cloud.githubusercontent.com/assets/369696/13223732/34cf7ffa-d98e-11e5-9a33-8f40f6498004.png)

    ![image](https://cloud.githubusercontent.com/assets/369696/13228435/ae570094-d9a4-11e5-9f3c-4737112a7932.png)

    Look to the below image. There is we 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_

    ```
    highway=residential
    lanes=3
    lanes:forward=1
    lanes:backward=1
    lanes:both_ways=1
    turn:lanes:both_ways=left
    ```
    ![image](https://cloud.githubusercontent.com/assets/369696/13229045/ab01d6f0-d9a7-11e5-8d8a-1fe5518c84a5.png)

    Case when number of lanes is even but numbers of lanes for each direction not equal.
    ![image](https://cloud.githubusercontent.com/assets/369696/13229897/b09a811c-d9ab-11e5-935e-25906c94585b.png)

    ### Dual carriageways roads
    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
    ![image](https://cloud.githubusercontent.com/assets/369696/13231932/5b417e00-d9b5-11e5-854e-dbed2d209d7c.png)