Changes between Version 63 and Version 69 of Styles/Lane_and_Road_Attributes
- Timestamp:
- (multiple changes)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Styles/Lane_and_Road_Attributes
v63 v69 1 1 [[TranslatedPages]] 2 2 [[PageOutline(2-10)]] 3 = [[Image(icon.svg, 36,middle,inline)]] Lanes and Road Attributes mappaint style3 = [[Image(icon.svg,48,link=,middle,inline,margin-right=20)]] Lanes and Road Attributes mappaint style 4 4 5 5 This style visualizes a number of lane and road specific attributes. Namely common variants of the following tags are considered: 6 6 * [[osmwiki:Key:lanes|lanes]]: Number of lanes for motorized traffic. 7 * [[osmwiki:Key:width|width]]: The width of the carriageway. Lane-dependent width using width:lanes is fully supported. 7 * [[osmwiki:Key:width|width]]: The width of the carriageway. Lane-dependent width using `width:lanes` is fully supported. 8 8 * [[osmwiki:Key:change|change]]: Allowed resp. forbidden lane changes. 9 9 * [[osmwiki:Key:turn|turn]]: Indication of turning lanes, including preliminary support for values hook_right and hook_left (this might change!) 10 * [[osmwiki:Key:cycleway|cycleway]]: Only cycle tracks are supported if specified with cycleway. Cycle lanes need bicycle:lanes=...|designated|... to be visible. 10 * [[osmwiki:Key:cycleway|cycleway]]: Only cycle tracks are supported if specified with cycleway. Cycle lanes need `bicycle:lanes=...|designated|...` to be visible. 11 11 * [[osmwiki:Key:bicycle|bicycle:lanes]]: Dedicated bicycle lanes. 12 12 * [[osmwiki:Key:bus|bus:lanes]]: Dedicated bus lanes. … … 19 19 * [[osmwiki:Proposed_features/highway=junction|highway=junction]]: Can be used to indicate the outline of a junction and group together all features of it. 20 20 * [[osmwiki:Relation:enforcement|Relation enforcement]]: The to and from members of such relations are highlighted 21 * [[osmwiki:Key:traffic_sign|traffic_sign]]: Traffic signs for speed limits and overtaking are displayed if tagged with traffic_sign=maxspeed/overtaking andmaxspeed=<limit>resp.overtaking=yes/no. The value implicit for maxspeed is interpreted as the end of the speed limit. Combinations like traffic_sign=maxspeed;overtaking are also supported.21 * [[osmwiki:Key:traffic_sign|traffic_sign]]: Traffic signs for speed limits and overtaking are displayed if tagged with `traffic_sign=maxspeed/overtaking` and `maxspeed=<limit>` resp. `overtaking=yes/no.` The value implicit for `maxspeed` is interpreted as the end of the speed limit. Combinations like `traffic_sign=maxspeed;overtaking` are also supported. 22 22 * [[osmwiki:Key:hov|hov:lanes]]: Dedicated HOV lanes. The minimum requirement can be specified by hov:minimum (supported values: 2 and 3) 23 23 * [[osmwiki:Relation:destination_sign|Relation destination_sign]]: Experimental and very limited support! … … 27 27 28 28 Furthermore: 29 * Common suffixes like :forward ,:backward, :left, :right: and :bothas well as the proposed :both_ways (for lanes in both directions) are supported where appropriate.29 * Common suffixes like `:forward`, `:backward`, `:left`, `:right` and `:both` as well as the proposed `:both_ways` (for lanes in both directions) are supported where appropriate. 30 30 * Some common tagging errors are detected and displayed, e.g. inconsistent number of lane-dependent values and typos in the keys turn and change. 31 * The style also supports '''left-hand traffic'''; see section Settings. 32 33 Use the [[Help/Dialog/MapPaint|Map Style Dialog]] to download and activate the style. A good starting point to see it in action is the [osmwww:#map=14/47.0705/15.4353 area around Graz in Austria].31 * The style also supports '''left-hand traffic'''; see section Settings, below. 32 33 Use the register [[JOSMImage(dialogs/mapstyle,24,link=,middle)]] [wikitr:/Help/Preferences/MapPaintPreference Map Paint Styles] in [[JOSMImage(preference)]] [wikitr:/Help/Action/Preferences Preferences] to download and activate the style. A good starting point to see it in action is the [osmwww:#map=14/47.0705/15.4353 area around Graz in Austria]. 34 34 35 35 To '''report bugs or provide feedback''' send [[osmwiki:User:Imagic|me a message]]. 36 36 37 37 == Settings 38 Some settings of the style can be configured using Edit -> Preferences -> Display settings -> Colours. All settings start with mappaint.lane.and.road.attributes. Settings that contain the text "boolean" treat white as yes and any other color as no. Settings that contain the text "opacity" use the lightness to specify the opacity (the values for transparency or alpha are completely ignored!) 39 * The settings '''carriage.way.backward''', '''carriage.way.forward''' and '''carriage.way.both_ways''' specify the colour of the respective lanes. 40 * The settings '''sidewalk''', '''cycletrack''' and '''combined.sidewalk.and.cycletrack''' specify the colour of the sidewalk, a cycletrack and a combined sidewalk and cycletrack 41 * If '''boolean.right.hand.traffic''' is set to white, lanes are rendered for right hand traffic, if set to black for left hand traffic and if set to anything else (which is now the default) the right- and left-hand traffic database from JOSM is used to automatically determine the side. 42 * If '''boolean.use.svg.for.turning.markings''' is set to white, the markings for turning lanes are rendered more precisely. '''If you run into memory problems, set this to black.''' If this is set to black, the setting '''integer.png.turn.variant''' can be used to specify which set of png images should be used for turn markings. Currently two sets are supplied (value 000000 and 000001). 43 * The settings '''opacity.lane''', '''opacity.markings''' and '''opacity.sidewalk''' specify the opacity of the lane background, road markings and the sidewalk background. If set to white they are opaque; if set to black they are completely transparent, any grey setting in between is treated an appropriate opacity. 38 Some settings of the style can be configured in [[JOSMImage(preference)]] [wikitr:/Help/Action/Preferences Preferences] in [[JOSMImage(preferences/color,24,link=,middle)]] [wikitr:/Help/Preferences/ColorPreference Colors] or in [wikitr:/Help/Preferences/Advanced Advanded preferences]. All settings start with **`Paint Style Lane and Road Attributes: `**, respectively, **`clr.mappaint.lane and road attributes.`**. Settings that contain the text **`Boolean_`** treat `white` (`#FFFFFF`) as `yes` and any other color as `no`. Settings that contain the text **`Opacity_`** use the lightness to specify the opacity (the values for `transparency` or `alpha` are completely ignored!) 39 * The settings **`Carriage_way_backward`**, **`Carriage_way_forward`** and **`Carriage_way_bothways`** specify the color of the respective lanes. 40 * The settings **`Sidewalk`**, **`Cycletrack`** and **`Combined_sidewalk_and_cycletrack`** specify the color of the sidewalk, a cycletrack and a combined sidewalk and cycletrack 41 * **`No_access`** sets the color of the dashes if lane's value in `access:lanes[:forward/backward/both_ways]=*` is `no` 42 * If **`Boolean_right_hand_traffic`** is set to `white` (`#FFFFFF`), lanes are rendered for right hand traffic, if set to `black` (`#000000`) for left hand traffic and if set to anything else (which is now the default) the right- and left-hand traffic [wikitr:/left-right-hand-traffic database] from JOSM is used to automatically determine the side. 43 * If **`Boolean_use_svg_for_turning_markings`** is set to `white`, the markings for turning lanes are rendered more precisely. **If you run into memory problems, set this to `black`**. 44 * If this is set to `black`, the setting **`Integer_PNG_turn_variant`** can be used to specify which set of png images should be used for turn markings. Currently two sets are supplied (value `#000000` and `#000001`). 45 * If **`Boolean_use_svg_for_destination`** is set to `white`, the destination texts are rendered more smoothly. 46 * The settings **`Opacity_lane`**, **`Opacity_markings`** and **`Opacity_sidewalk`** specify the opacity of the lane background, road markings and the sidewalk background. If set to `white` they are opaque; if set to `black` they are completely transparent, any `grey` setting in between is treated an appropriate opacity. 47 * If **`Boolean_show_warning`** is set to `white` warnings about `:lanes` tags are rendered 48 * If **`Boolean_show_error`** is set to `white` error about `:lanes` tags are rendered 49 * If **`Boolean_show_disputed`** is set to `white`, disputed warnings about non numerical values for `maxspeed` and missing tag `source:maxspeed` or its value not in format `<country code>:<context>` are rendered. 50 44 51 45 52 == Known limitations/bugs 46 * [[ticket:8429|A bug in JOSM]] leads sometimes to rendering art efacts.53 * [[ticket:8429|A bug in JOSM]] leads sometimes to rendering artifacts. 47 54 * Left-hand traffic is nearly untested. Please provide feedback. 48 * Roads with oneway=-1 may lead to incorrect results. Please provide feedback. 49 * change:lanes without suffix is currently only supported on one-ways and for the special case of change:lanes=no|no. 55 * Roads with `oneway=-1` may lead to incorrect results. Please provide feedback. 56 * `change:lanes` without suffix is currently only supported on one-ways and for the special case of `change:lanes=no|no`. 50 57 * In forward and backward direction a maximum of eight lanes and for lanes in both directions a maximum of four lanes is displayed. 51 * turn:lanes (without forward or backward) is only used when combined with oneway=yes. 58 * `turn:lanes` (without `forward` or `backward`) is only used when combined with `oneway=yes`. 59 * Width as shown in the mapview is not accurate (#8588) 52 60 53 61 == Acknowledgments … … 57 65 58 66 == Preset 59 An appropriate preset for lane attributes is available at [wiki :Presets/LaneAttributes Lane Attributes].67 An appropriate preset for lane attributes is available at [wikitr:/Presets/LaneAttributes Lane Attributes]. 60 68 61 69 == Screenshot 62 [[Image(Screenshot_Style_Lane_and_Road_Attributes.jpeg)]] 70 [[Image(Screenshot_Style_Lane_and_Road_Attributes.jpeg,link=)]] 63 71 64 72 == Code … … 1670 1678 } 1671 1679 1672 1680 /** 1681 * Convert width to meters 1682 */ 1683 way[width=~/^(\d+)'$/] { 1684 road_width: 0.3048 * get(regexp_match("^(\\d+)'$", tag(width)), 1); 1685 } 1686 way[width=~/^(\d+)"$/] { 1687 road_width: 0.0254 * get(regexp_match("^(\\d+)\"$", tag(width)), 1); 1688 } 1689 way[width=~/^(\d+)'(\d+)"$/] { 1690 _match: regexp_match("^(\\d+)'(\\d+)\"$", tag(width)); 1691 road_width: 0.3048 * get(prop(_match), 1) + 0.0254 * get(prop(_match), 2); 1692 } 1693 way[width=~/^(\d+)(\.\d+)?$/] { 1694 road_width: tag(width); 1695 } 1673 1696 /*-------------------------------------------------------------------------------------------------------------------------------------------------*/ 1674 1697 /* Determine the width of the lanes, road markings and the inner lane width */ … … 1677 1700 { 1678 1701 lane_min_width: 4; 1679 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1702 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1680 1703 change_allowed: list(6,9); 1681 1704 road_marking_width: 1; … … 1686 1709 { 1687 1710 lane_min_width: 8; 1688 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1711 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1689 1712 change_allowed: list(12,18); 1690 1713 road_marking_width: 2; … … 1695 1718 { 1696 1719 lane_min_width: 8; 1697 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1720 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1698 1721 change_allowed: list(24,36); 1699 1722 road_marking_width: 2; … … 1704 1727 { 1705 1728 lane_min_width: 8; 1706 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1729 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1707 1730 change_allowed: list(48,72); 1708 1731 road_marking_width: 2; … … 1713 1736 { 1714 1737 lane_min_width: 12; 1715 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1738 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1716 1739 change_allowed: list(96,144); 1717 1740 road_marking_width: 4; … … 1722 1745 { 1723 1746 lane_min_width: 20; 1724 lane_default_width: eval(max(prop(lane_min_width),( has_tag_key(width)?((prop(pixel_per_metre,"default")*tag(width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default")))));1747 lane_default_width: eval(max(prop(lane_min_width),(is_prop_set(road_width)?((prop(pixel_per_metre,"default")*prop(road_width))/prop(lanes_all)):(3*prop(pixel_per_metre,"default"))))); 1725 1748 change_allowed: list(192,288); 1726 1749 road_marking_width: 6;