Browse Source

Lanes: improvements (cycle lanes, parking lanes, lane markings, ...)

name-etym
parent
commit
84173b6c6d
  1. 153
      lanes.json

153
lanes.json

@ -4,15 +4,27 @@
"en": "Lanes" "en": "Lanes"
}, },
"query": { "query": {
"17": "way[lanes];"
"17": [
"(",
"way[lanes];",
"way['parking:lane:left'];",
"way['parking:lane:right'];",
"way['parking:lane:both'];",
")"
]
}, },
"feature": { "feature": {
"pre": [ "pre": [
"{% set parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lang:both')) %}",
"{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lang:both')) %}",
"{% set lanes_width = tags.lanes * 3 %}"
"{% set parking_left = attribute(tags, 'parking:lane:left')|default(attribute(tags, 'parking:lane:both')) %}",
"{% set parking_right = attribute(tags, 'parking:lane:right')|default(attribute(tags, 'parking:lane:both')) %}",
"{% set cyclelane_left = 'opposite_lane' in tags.cycleway|split(';') ? 1 : 0 %}",
"{% set cyclelane_right = 'lane' in tags.cycleway|split(';') ? 1 : 0 %}",
"{% set lanes = tags.lanes|default(1) %}",
"{% set lanes_width = lanes * 3 %}",
"{% set forward_lanes = attribute(tags, 'lanes:forward')|default(tags.oneway in ['yes','1'] ? lanes : lanes / 2) %}",
"{% set backward_lanes = attribute(tags, 'lanes:backward')|default(tags.oneway in ['yes','1'] ? 0 : lanes / 2) %}"
], ],
"description": "{{ tags.gauge|default(trans('unknown'))|enumerate }}",
"description": "{{ keyTrans('lanes') }}: {{ lanes }} | {{ forward_lanes }} {{ backward_lanes }}",
"body": [ "body": [
"{{ tagTrans('railway', tags.railway) }}<br/>", "{{ tagTrans('railway', tags.railway) }}<br/>",
"{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}", "{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
@ -23,7 +35,7 @@
], ],
"markerSymbol": null, "markerSymbol": null,
"listMarkerSymbol": "line", "listMarkerSymbol": "line",
"styles": "{% if parking_left %}parking_left,{% endif %}lanes{% for i in 1..tags.lanes - 1 %},mark{{ i }}{% endfor %}",
"styles": "{% if parking_left %}parking_left,{% endif %}{% if cyclelane_left %}cyclelane_left,{% endif %}{% if lanes == 1 %}lane1{% else %}{% for i in 1..lanes - 1 %}lane{{ i }},mark{{ i }},{% endfor %}lane{{ lanes }}{% endif %}{% if cyclelane_right %},cyclelane_right{% endif %}{% if parking_right %},parking_right{% endif %}",
"style": { "style": {
"width": "{{ width }}", "width": "{{ width }}",
"pane": "casing", "pane": "casing",
@ -32,98 +44,175 @@
"style:parking_left": { "style:parking_left": {
"width": "2m", "width": "2m",
"color": "orange", "color": "orange",
"offset": "{{ lanes_width / -2 - (cyclelane_left * 2) - 1 }}m",
"pane": "casing"
},
"style:cyclelane_left": {
"width": "2m",
"color": "green",
"offset": "{{ lanes_width / -2 - 1 }}m", "offset": "{{ lanes_width / -2 - 1 }}m",
"text": "foobar"
"pane": "casing"
},
"style:cyclelane_right": {
"width": "2m",
"color": "green",
"offset": "{{ lanes_width / 2 + 1 }}m",
"pane": "casing"
},
"style:parking_right": {
"width": "2m",
"color": "orange",
"offset": "{{ lanes_width / 2 + (cyclelane_right * 2) + 1 }}m",
"pane": "casing"
},
"style:lane1": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 1.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane2": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 4.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane3": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 7.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane4": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 10.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane5": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 13.5 }}m",
"color": "grey",
"pane": "casing"
}, },
"style:lanes": {
"width": "{{ lanes_width }}m",
"style:lane6": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 16.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane7": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 19.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane8": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 22.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane9": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 25.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane10": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 28.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane11": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 31.5 }}m",
"color": "grey",
"pane": "casing"
},
"style:lane12": {
"width": "3m",
"offset": "{{ lanes_width / -2 + 34.5 }}m",
"color": "grey", "color": "grey",
"pane": "casing" "pane": "casing"
}, },
"style:mark1": { "style:mark1": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 3 }}m", "offset": "{{ lanes_width / -2 + 3 }}m",
"dashArray": "{% if forward_lanes != 1 and lanes - backward_lanes != 1 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark2": { "style:mark2": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 6 }}m", "offset": "{{ lanes_width / -2 + 6 }}m",
"dashArray": "{% if forward_lanes != 2 and lanes - backward_lanes != 2 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark3": { "style:mark3": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 9 }}m", "offset": "{{ lanes_width / -2 + 9 }}m",
"dashArray": "{% if forward_lanes != 3 and lanes - backward_lanes != 3 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark4": { "style:mark4": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 12 }}m", "offset": "{{ lanes_width / -2 + 12 }}m",
"dashArray": "{% if forward_lanes != 4 and lanes - backward_lanes != 4 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark5": { "style:mark5": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 15 }}m", "offset": "{{ lanes_width / -2 + 15 }}m",
"dashArray": "{% if forward_lanes != 5 and lanes - backward_lanes != 5 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark6": { "style:mark6": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 6 and lanes - backward_lanes != 6 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark7": { "style:mark7": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 7 and lanes - backward_lanes != 7 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark8": { "style:mark8": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 8 and lanes - backward_lanes != 8 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark9": { "style:mark9": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 9 and lanes - backward_lanes != 9 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark10": { "style:mark10": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 10 and lanes - backward_lanes != 10 %}5,5{% endif %}",
"color": "white" "color": "white"
}, },
"style:mark11": { "style:mark11": {
"width": "1", "width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m", "offset": "{{ lanes_width / -2 + 18 }}m",
"color": "white"
},
"style:mark12": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 11 and lanes - backward_lanes != 11 %}5,5{% endif %}",
"color": "white" "color": "white"
} }
}, },
"info": [ "info": [
"{{ map.metersPerPixel }}",
"<table>", "<table>",
" {% set color = '#ff0000' %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ trans('illegal value') }}</td>",
" </tr>",
" {% set color = '#404040' %}",
" <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ trans('unknown') }}</td>",
" </tr>",
"{% for i in range(0, 1800, 250) %}",
" {% set color = colorInterpolate([ '#00ff00', '#0000ff' ], i / 2000) %}",
" <tr>", " <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': color })|raw }}</td>",
" <td>{{ i }}mm</td>",
" <td>{{ markerLine({'styles':'left,right,mark', 'style:left': { 'width': 3, 'color': 'grey', 'offset': -1.5 },'style:right': { 'width': 3, 'color': 'grey', 'offset': 1.5 },'style:mark': { 'width': 1, 'color': 'white'} })|raw }}</td>",
" <td>{{ keyTrans('lanes') }}</td>",
" </tr>", " </tr>",
"{% endfor %}",
" <tr>", " <tr>",
" <td>{{ markerLine({ 'width': 3, 'color': '#0000ff' })|raw }}</td>",
" <td>>2000mm</td>",
" <td>{{ markerLine({'styles':'left,right,mark', 'style:left': { 'width': 3, 'color': 'grey', 'offset': -1.5 },'style:right': { 'width': 3, 'color': 'grey', 'offset': 1.5 },'style:mark': { 'width': 1, 'color': 'white', 'dashArray': '5,5'} })|raw }}</td>",
" <td>{{ keyTrans('lanes') }}</td>",
" </tr>", " </tr>",
"</table>" "</table>"
] ]

Loading…
Cancel
Save