A repository for testing purposes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
9.1 KiB

{
"type": "overpass",
"name": {
"en": "Lanes"
},
"query": {
"17": [
"(",
"way[lanes];",
"way['parking:lane:left'];",
"way['parking:lane:right'];",
"way['parking:lane:both'];",
")"
]
},
"feature": {
"pre": [
"{% 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": "{{ keyTrans('lanes') }}: {{ lanes }} | {{ forward_lanes }} {{ backward_lanes }}",
"body": [
"{{ tagTrans('railway', tags.railway) }}<br/>",
"{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}",
"{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}",
"{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}",
"{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown'))|enumerate }}<br/>",
"{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}<br/>{% endif %}"
],
"markerSymbol": null,
"listMarkerSymbol": "line",
"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": {
"width": "{{ width }}",
"pane": "casing",
"color": "{% if tags.gauge %}{% if not tags.gauge|matches('^\\d+$') %}#ff0000{% else %}{{ colorInterpolate([ '#00ff00', '#0000ff' ], tags.gauge / 2000) }}{% endif %}{% else %}#404040{% endif %}"
},
"style:parking_left": {
"width": "2m",
"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",
"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: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",
"pane": "casing"
},
"style:mark1": {
"width": "1",
"offset": "{{ lanes_width / -2 + 3 }}m",
"dashArray": "{% if forward_lanes != 1 and lanes - backward_lanes != 1 %}5,5{% endif %}",
"color": "white"
},
"style:mark2": {
"width": "1",
"offset": "{{ lanes_width / -2 + 6 }}m",
"dashArray": "{% if forward_lanes != 2 and lanes - backward_lanes != 2 %}5,5{% endif %}",
"color": "white"
},
"style:mark3": {
"width": "1",
"offset": "{{ lanes_width / -2 + 9 }}m",
"dashArray": "{% if forward_lanes != 3 and lanes - backward_lanes != 3 %}5,5{% endif %}",
"color": "white"
},
"style:mark4": {
"width": "1",
"offset": "{{ lanes_width / -2 + 12 }}m",
"dashArray": "{% if forward_lanes != 4 and lanes - backward_lanes != 4 %}5,5{% endif %}",
"color": "white"
},
"style:mark5": {
"width": "1",
"offset": "{{ lanes_width / -2 + 15 }}m",
"dashArray": "{% if forward_lanes != 5 and lanes - backward_lanes != 5 %}5,5{% endif %}",
"color": "white"
},
"style:mark6": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 6 and lanes - backward_lanes != 6 %}5,5{% endif %}",
"color": "white"
},
"style:mark7": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 7 and lanes - backward_lanes != 7 %}5,5{% endif %}",
"color": "white"
},
"style:mark8": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 8 and lanes - backward_lanes != 8 %}5,5{% endif %}",
"color": "white"
},
"style:mark9": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 9 and lanes - backward_lanes != 9 %}5,5{% endif %}",
"color": "white"
},
"style:mark10": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 10 and lanes - backward_lanes != 10 %}5,5{% endif %}",
"color": "white"
},
"style:mark11": {
"width": "1",
"offset": "{{ lanes_width / -2 + 18 }}m",
"dashArray": "{% if forward_lanes != 11 and lanes - backward_lanes != 11 %}5,5{% endif %}",
"color": "white"
}
},
"info": [
"<table>",
" <tr>",
" <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>",
" <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>",
"</table>"
]
}