-
Notifications
You must be signed in to change notification settings - Fork 11
/
railway-infrastructure.yaml
235 lines (228 loc) · 8.51 KB
/
railway-infrastructure.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
type: overpass
name:
ca: Infraestructura fèrria
cs: Železniční infrastruktura
de: Eisenbahn Infrastruktur
en: Railway infrastructure
es: Infraestructura ferroviaria
fr: Infrastructure ferroviaire
gl: Infraestrutura do ferrocarril
hu: Vasúti infrastruktúra
it: Infrastruttura ferroviaria
ja: 鉄道インフラ
nb: Jernbane-infrastruktur
nl: Spoorweginfrastructuur
oc: Infrastructura ferroviària
pl: Infrastruktura kolejowa
pt: Infraestrutura ferroviária
pt-br: Infraestrutura ferroviária
ru: Железнодорожная инфраструктура
sr: Железничка инфраструктура
tr: Demiryolu altyapısı
query:
11: (way[railway=rail][usage~'^(main|branch)$'];node[railway~'^(station)$'];)
14: (way[railway];node[railway~'^(station|halt|tram_stop)$'];)
17: (node[railway];way[railway];)
feature:
pre: |-
{% set width = 2 %}
{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}
{% set width = 1 %}
{% elseif tags.railway in ['rail', 'narrow_gauge', 'abandoned', 'disused', 'razed'] %}
{% if tags.usage in ['main', 'branch'] %}
{% set width = 3 %}
{% else %}
{% set width = 2 %}
{% endif %}
{% elseif tags.railway in ['signal', 'switch', 'railway_crossing'] %}
{% set width = 0 %}
{% endif %}
title: |-
{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}
{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator')) }}
{% if attribute(tags, 'tunnel:name') %}- {{ localizedTag(tags, 'tunnel:name') }}{% endif %}
{% if attribute(tags, 'bridge:name') %}- {{ localizedTag(tags, 'bridge:name') }}{% endif %}
details: |-
{{ width }}
description: |-
{{ tagTrans('railway', tags.railway) -}}
{%- if tags.usage %}
, {{ tagTrans('railway=rail usage', tags.usage) }}
{% endif -%}
{%- if tags.service %}
, {{ tagTrans('railway=rail service', tags.service) }}
{% endif -%}
body: |-
{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}
{% if tags.usage %}{{ keyTrans('railway=rail usage') }}: {{ tagTrans('railway=rail usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}
{% if tags.service %}{{ keyTrans('railway=rail service') }}: {{ tagTrans('railway=rail service', tags.service ) }}<br/>{% endif %}
{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<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')) }}
{% endif %}<br/>
markerSign: |-
{% if tags.railway in [ 'halt', 'tram_stop', 'station', 'stop', 'subway_entrance' ] %}X
{% endif %}
markerSymbol: |-
{% if tags.railway == 'signal' %}
<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;' />
<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;'/>
</svg>
{% elseif tags.railway == 'switch' %}
<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;' />
<line x1='2' x2='2' y1='2' y2='13' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>
<line x1='2' x2='7' y1='10' y2='2' style='stroke-width: 2; stroke: #000000; stroke-linecap: round;'/>
</svg>
{% elseif tags.railway == 'railway_crossing' %}
<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;' />
<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;'/>
</svg>
{% elseif tags.railway not in [ 'rail', 'tram', 'subway', 'narrow_gauge', 'abandoned', 'disused', 'razed' ] %}
{{ markerPointer({})|raw }}
{% endif %}
listMarkerSymbol: |-
{% if tags.railway in [ 'station', 'halt', 'tram_stop', 'stop', 'subway_entrance', 'signal', 'switch', 'railway_crossing' ] %}
{% else %}
line
{% endif %}
priority: |-
{% if tags.railway == 'station' %}0
{% elseif tags.railway in [ 'halt' ] %}1
{% elseif tags.railway in [ 'tram_stop', 'stop' ] %}2
{% elseif tags.railway in [ 'subway_entrance' ] %}3
{% else %}5
{% endif %}
styles: |-
{% if tags.bridge and tags.bridge != 'no' %}casing_bridge,{% endif %}
{% if const.color[tags.railway] %}casing,casing_layer,{% endif %}
{% if tags.railway in ['abandoned', 'disused', 'razed'] %}disused,{% endif %}
{% if tags.railway == 'narrow_gauge' %}default,narrow
{% else %}default
{% endif %}
style:
width: |-
{{ width }}
zIndex: |-
{{ tags.layer|default(0) + 10 }}
color: |-
{% set color = tags.railway == 'rail' or tags.railway == 'narrow_gauge' or tags.railway == 'disused' ? const.color['rail/' ~ tags.usage]|default(const.color.rail) : const.color[tags.railway]|default(const.color.default) %}
{% if tags.tunnel and tags.tunnel != 'no' %}
{{ colorInterpolate([ color, '#ffffff' ], 0.3) }}
{% else %}
{{ color }}
{% endif %}
opacity: 1
dashArray: |-
{% if tags.railway == 'disused' %}1,5
{% elseif tags.railway == 'abandoned' %}1,7
{% elseif tags.railway == 'razed' %}1,9
{% endif %}
fill: |-
{% if tags.railway == 'platform' %}
1
{% elseif type == 'node' %}
1
{% else %}
{% endif %}
fillColor: |-
{% if tags.railway == 'platform' %}
#3f3f3f
{% elseif type == 'node' %}
#ffffff
{% endif %}
fillOpacity: |-
{% if tags.railway == 'platform' %}
0.2
{% elseif type == 'node' %}
0
{% endif %}
style:disused:
width: |-
{{ width }}
zIndex: |-
{{ tags.layer|default(0) + 9.995 }}
color: white
opacity: 1
fill: false
style:casing:
color: '#ffffff'
pane: casing
width: |-
{{ width + 2 }}
style:casing_layer:
color: '#ffffff'
zIndex: |-
{{ tags.layer|default(0) + 9.99 }}
width: |-
{{ width + 2 }}
lineCap: butt
style:casing_bridge:
color: '#000000'
zIndex: |-
{{ tags.layer|default(0) + 9.98 }}
width: |-
{{ width + 4 }}
lineCap: butt
style:narrow:
width: |-
{{ width + 2 }}
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'
info: |-
<table>
<tr>
<td>{{ markerLine(evaluate({ "railway": "rail", "usage": "main" }))|raw }}</td>
<td>{{ tagTrans('railway', 'rail') }}, {{ keyTrans('usage') }}: {{ tagTrans('usage', 'main') }}</td>
</tr>
<tr>
<td>{{ markerLine(evaluate({ "railway": "rail" }))|raw }}</td>
<td>{{ tagTrans('railway', 'rail') }}</td>
</tr>
<tr>
<td>{{ markerLine(evaluate({ "railway": "narrow_gauge" }))|raw }}</td>
<td>{{ tagTrans('railway', 'narrow_gauge') }}</td>
</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>{{ tagTrans('railway', 'subway') }}</td>
</tr>
{% if map.zoom >= 14 %}
<tr>
<td>{{ markerLine(evaluate({ "railway": "tram" }))|raw }}</td>
<td>{{ tagTrans('railway', 'tram') }}</td>
</tr>
{% endif %}
</table>
const:
color:
rail: '#000000'
rail/main: '#ff8100'
rail/branch: '#daca00'
subway: '#0000ff'
tram: '#ff00ff'
light_rail: '#00BD14'
platform: '#3f3f3f'
default: '#000000'