|
@ -10,6 +10,19 @@ |
|
|
"17": "(node[railway];way[railway];)" |
|
|
"17": "(node[railway];way[railway];)" |
|
|
}, |
|
|
}, |
|
|
"feature": { |
|
|
"feature": { |
|
|
|
|
|
"pre": [ |
|
|
|
|
|
"{% set railway_type = null %}", |
|
|
|
|
|
"", |
|
|
|
|
|
"{% if tags.railway == 'disused' %}", |
|
|
|
|
|
" {% set railway_type = attribute(tags, 'disused:railway')|default(tags.disused)|default('rail') %}", |
|
|
|
|
|
"{% elseif tags.railway == 'abandoned' %}", |
|
|
|
|
|
" {% set railway_type = attribute(tags, 'abandoned:railway')|default(tags.abandoned)|default('rail') %}", |
|
|
|
|
|
"{% elseif tags.railway == 'proposed' %}", |
|
|
|
|
|
" {% set railway_type = attribute(tags, 'proposed:railway')|default(tags.proposed)|default('rail') %}", |
|
|
|
|
|
"{% elseif tags.railway in [ 'rail', 'narrow_gauge', 'subway', 'light_rail', 'tram' ] %}", |
|
|
|
|
|
" {% set railway_type = tags.railway %}", |
|
|
|
|
|
"{% endif %}" |
|
|
|
|
|
], |
|
|
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", |
|
|
"title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}", |
|
|
"description": "{{ tagTrans('railway', tags.railway) }}", |
|
|
"description": "{{ tagTrans('railway', tags.railway) }}", |
|
|
"body": [ |
|
|
"body": [ |
|
@ -20,14 +33,14 @@ |
|
|
"{% 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 %}", |
|
|
"{% 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 %}", |
|
|
"" |
|
|
"" |
|
|
], |
|
|
], |
|
|
"markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X{% endif %}", |
|
|
|
|
|
|
|
|
"markerSign": "{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}H{% endif %}", |
|
|
"markerSymbol": [ |
|
|
"markerSymbol": [ |
|
|
"{% if tags.railway == 'signal' %}", |
|
|
"{% if tags.railway == 'signal' %}", |
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />", |
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #000000; fill-opacity: 1;' />", |
|
|
" <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>", |
|
|
" <circle cx='4.5' cy='4.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #7f7f7f;'/>", |
|
|
" <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>", |
|
|
" <circle cx='4.5' cy='10.5' r='2.5' style='stroke-width: 1; stroke: #000000; fill: #ff0000;'/>", |
|
|
"</svg>", |
|
|
|
|
|
|
|
|
"</Xsvg>", |
|
|
"{% elseif tags.railway == 'switch' %}", |
|
|
"{% elseif tags.railway == 'switch' %}", |
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
"<svg anchorX='5' anchorY='8' width='9' height='15'>", |
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />", |
|
|
" <rect x='0.5' y='0.5' width='8' height='14' style='fill: #ffffff; fill-opacity: 1;' />", |
|
@ -40,8 +53,6 @@ |
|
|
" <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
" <line x1='2' x2='7' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
" <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
" <line x1='7' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>", |
|
|
"</svg>", |
|
|
"</svg>", |
|
|
"{% elseif tags.railway not in [ 'rail', 'tram', 'subway', 'narrow_gauge', 'abandoned', 'disused' ] %}", |
|
|
|
|
|
"{{ markerPointer({})|raw }}", |
|
|
|
|
|
"{% endif %}" |
|
|
"{% endif %}" |
|
|
], |
|
|
], |
|
|
"listMarkerSymbol": [ |
|
|
"listMarkerSymbol": [ |
|
@ -58,30 +69,43 @@ |
|
|
"{% else %}5", |
|
|
"{% else %}5", |
|
|
"{% endif %}" |
|
|
"{% endif %}" |
|
|
], |
|
|
], |
|
|
"styles": "{% if tags.railway == 'narrow_gauge' %}default,casing{% else %}default{% endif %}", |
|
|
|
|
|
|
|
|
"styles": [ |
|
|
|
|
|
"{% if railway_type %}", |
|
|
|
|
|
"highlight,default", |
|
|
|
|
|
"{% else %}", |
|
|
|
|
|
"default", |
|
|
|
|
|
"{% endif %}" |
|
|
|
|
|
], |
|
|
"style": { |
|
|
"style": { |
|
|
"width": [ |
|
|
"width": [ |
|
|
"{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
|
|
|
|
|
|
"{% if tags.railway in [ 'platform' ] %}", |
|
|
|
|
|
"1", |
|
|
|
|
|
"{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", |
|
|
|
|
|
"0", |
|
|
|
|
|
"{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
"1", |
|
|
"1", |
|
|
|
|
|
"{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
|
|
" 3", |
|
|
"{% else %}", |
|
|
"{% else %}", |
|
|
" {% if tags.railway == 'rail' %}", |
|
|
|
|
|
" {% if tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
|
|
" 3", |
|
|
|
|
|
" {% else %}", |
|
|
|
|
|
" 2", |
|
|
|
|
|
" {% endif %}", |
|
|
|
|
|
" {% elseif tags.railway == 'platform' %}", |
|
|
|
|
|
" 1", |
|
|
|
|
|
" {% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", |
|
|
|
|
|
" 0", |
|
|
|
|
|
" {% else %}", |
|
|
|
|
|
" 2", |
|
|
" 2", |
|
|
" {% endif %}", |
|
|
|
|
|
"{% endif %}" |
|
|
"{% endif %}" |
|
|
], |
|
|
], |
|
|
"color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#ff8100{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", |
|
|
|
|
|
|
|
|
"color": "{{ const[railway_type].color }}", |
|
|
"opacity": "1", |
|
|
"opacity": "1", |
|
|
"dashArray": "{% if tags.railway == 'rail' %}{% elseif tags.railway == 'disused' %}1,5{% elseif tags.railway == 'abandoned' %}1,7{% endif %}", |
|
|
|
|
|
|
|
|
"lineCap": [ |
|
|
|
|
|
"{% if tags.railway in [ 'disused', 'abandoned', 'proposed' ] %}", |
|
|
|
|
|
"butt", |
|
|
|
|
|
"{% else %}", |
|
|
|
|
|
"round", |
|
|
|
|
|
"{% endif %}" |
|
|
|
|
|
], |
|
|
|
|
|
"dashArray": [ |
|
|
|
|
|
"{% if tags.railway == 'disused' %}1,5", |
|
|
|
|
|
"{% elseif tags.railway == 'abandoned' %}1,7", |
|
|
|
|
|
"{% elseif tags.railway == 'proposed' %}2,2", |
|
|
|
|
|
"{% elseif tags.tunnel %}5,5", |
|
|
|
|
|
"{% endif %}" |
|
|
|
|
|
], |
|
|
"fill": [ |
|
|
"fill": [ |
|
|
"{% if tags.railway == 'platform' %}", |
|
|
"{% if tags.railway == 'platform' %}", |
|
|
"1", |
|
|
"1", |
|
@ -105,11 +129,21 @@ |
|
|
"{% endif %}" |
|
|
"{% endif %}" |
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
"style:casing": { |
|
|
|
|
|
"width": "{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}5{% else %}{% if tags.railway == 'rail' %}{% if tags.usage == 'main' or tags.usage == 'branch' %}7{% else %}6{% endif %}{% elseif tags.railway == 'platform' %}5{% else %}6{% endif %}{% endif %}", |
|
|
|
|
|
"color": "{% if tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' %}{% if tags.usage == 'main' %}#ff8100{% elseif tags.usage == 'branch' %}#daca00{% else %}#000000{% endif %}{% elseif tags.railway == 'subway' %}#0000ff{% elseif tags.railway == 'tram' %}#ff00ff{% elseif tags.railway == 'light_rail' %}#00BD14{% elseif tags.railway == 'platform' %}#3f3f3f{% else %}#000000{% endif %}", |
|
|
|
|
|
"lineCap": "butt", |
|
|
|
|
|
"dashArray": "2,4" |
|
|
|
|
|
|
|
|
"style:highlight": { |
|
|
|
|
|
"width": [ |
|
|
|
|
|
"{% if tags.railway in [ 'platform' ] %}", |
|
|
|
|
|
"1", |
|
|
|
|
|
"{% elseif tags.railway in [ 'signal', 'switch', 'railway_crossing' ] %}", |
|
|
|
|
|
"0", |
|
|
|
|
|
"{% elseif tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}", |
|
|
|
|
|
"1", |
|
|
|
|
|
"{% elseif tags.usage == 'main' or tags.usage == 'branch' %}", |
|
|
|
|
|
" 3", |
|
|
|
|
|
"{% else %}", |
|
|
|
|
|
" 2", |
|
|
|
|
|
"{% endif %}" |
|
|
|
|
|
], |
|
|
|
|
|
"color": "#ffffff" |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
"info": [ |
|
|
"info": [ |
|
@ -119,6 +153,10 @@ |
|
|
" <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>", |
|
|
" </tr>", |
|
|
" </tr>", |
|
|
" <tr>", |
|
|
" <tr>", |
|
|
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"rail\", \"usage\": \"branch\" }))|raw }}</td>", |
|
|
|
|
|
" <td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'branch') }}</td>", |
|
|
|
|
|
" </tr>", |
|
|
|
|
|
" <tr>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"rail\" }))|raw }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'rail') }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'rail') }}</td>", |
|
|
" </tr>", |
|
|
" </tr>", |
|
@ -127,13 +165,13 @@ |
|
|
" <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'narrow_gauge') }}</td>", |
|
|
" </tr>", |
|
|
" </tr>", |
|
|
" <tr>", |
|
|
" <tr>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>", |
|
|
|
|
|
" <td>{{ tagTrans('railway', 'light_rail') }}</td>", |
|
|
|
|
|
" </tr>", |
|
|
|
|
|
" <tr>", |
|
|
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"subway\" }))|raw }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'subway') }}</td>", |
|
|
" <td>{{ tagTrans('railway', 'subway') }}</td>", |
|
|
" </tr>", |
|
|
" </tr>", |
|
|
|
|
|
" <tr>", |
|
|
|
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"light_rail\" }))|raw }}</td>", |
|
|
|
|
|
" <td>{{ tagTrans('railway', 'light_rail') }}</td>", |
|
|
|
|
|
" </tr>", |
|
|
"{% if map.zoom >= 14 %}", |
|
|
"{% if map.zoom >= 14 %}", |
|
|
" <tr>", |
|
|
" <tr>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>", |
|
|
" <td>{{ markerLine(evaluate({ \"railway\": \"tram\" }))|raw }}</td>", |
|
@ -141,5 +179,22 @@ |
|
|
" </tr>", |
|
|
" </tr>", |
|
|
"{% endif %}", |
|
|
"{% endif %}", |
|
|
"</table>" |
|
|
"</table>" |
|
|
] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
], |
|
|
|
|
|
"const": { |
|
|
|
|
|
"rail": { |
|
|
|
|
|
"color": "#000000" |
|
|
|
|
|
}, |
|
|
|
|
|
"narrow_gauge": { |
|
|
|
|
|
"color": "#7f003f" |
|
|
|
|
|
}, |
|
|
|
|
|
"subway": { |
|
|
|
|
|
"color": "#0000ff" |
|
|
|
|
|
}, |
|
|
|
|
|
"light_rail": { |
|
|
|
|
|
"color": "#7f00ff" |
|
|
|
|
|
}, |
|
|
|
|
|
"tram": { |
|
|
|
|
|
"color": "#ff00ff" |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |