-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuildings-height.yaml
150 lines (145 loc) · 4.41 KB
/
buildings-height.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
name:
ca: Alçada de l'edifici
cs: Výška budovy
de: Gebäudehöhen
en: Building height
es: Altura del edificio
fr: Hauteur
gl: Altitude do edificio
hu: Épületek magassága
it: Altezza dell'edificio
ja: 建物の高さ
nb: Bygningshøyde
nl: Bouwhoogte
oc: Autor de la bastissa
pl: Wysokości budynków
pt-br: Altura
pt: Altura dos edifícios
ro: Înălțimea clădirii
ru: Высота здания
sr: Висина зграде
tr: Bina yüksekliği
query:
16: |-
(
way[building];
relation[building];
)
feature:
pre: |-
{% if tags.height is defined %}
{% set approxHeight = tags.height %}
{% set m = tags.height|matches('(.*)\s*(m|ft)$') %}
{% if m and m[2] == 'm' %}{% set approxHeight = m[1] %}{% endif %}
{% if m and m[2] == 'ft' %}{% set approxHeight = m[1] / 3.2808 %}{% endif %}
{% elseif attribute(tags, 'building:levels') is defined %}
{% set approxHeight = attribute(tags, 'building:levels') * 3.5 %}
{% endif %}
{% if approxHeight <= 50 %}
{% set color = colorInterpolate(['green', 'red'], approxHeight / 50) %}
{% elseif approxHeight %}
{% set color = colorInterpolate(['red', 'yellow'], (approxHeight - 50) / 250) %}
{% else %}
{% set color = '#7f7f7f' %}
{% endif %}
description: |-
{% if tags.building == 'yes' and tags.military %}
{{ tagTrans('building', 'military') }}
{% elseif tags.building == 'yes' %}
{{ keyTrans('building') }}
{% else %}
{{ tagTransList('building', tags.building) }}
{% endif %}
{% if tags.building == 'construction' and tags.construction %}
({{ tagTransList('building', tags.construction) }})
{% endif %}
{% if tags.building in [ 'yes', 'military' ] and tags.military %}
({{ tagTransList('military', tags.military) }})
{% endif %}
details: |-
{% if tags.height is defined %}
{% if tags.height|matches('(m|ft)$') %}{{ tags.height -}}
{% else %}{{ tags.height }} m
{%- endif -%}
{% endif -%}
{%- if attribute(tags, 'building:levels') is defined -%}
{%- if tags.height is defined %}, {% endif %}
{{ attribute(tags, 'building:levels') }} {{ keyTrans('building:levels') }}
{% endif %}
markerSymbol: null
listMarkerSymbol: |-
{{ markerPolygon({"fillColor": color, "fillOpacity": 0.8, "width": 1, "color": "#000000" })|raw }}
markerSign: |-
{% if map.zoom >= 18 %}
<span style="color: white; font-size: 80%; line-height: 80%;">
{%- if attribute(tags, 'building:levels') is defined -%}
{{ attribute(tags, 'building:levels') }}
<br>
{% endif %}
{% if tags.height is defined %}
{% if tags.height|matches('(m|ft)$') %}({{ tags.height -}})
{% else %}({{ tags.height }}m)
{%- endif -%}
{% endif -%}
</span>
{% else %} {% endif %}
listMarkerSign: ' '
priority: |-
{{ (approxHeight|default(0)) * -1 }}
style:
width: 1
color: '#000000'
fillColor: |-
{{ color }}
fillOpacity: 1
info: |-
<div style='display: inline-block'>
{{ tagTrans('height') }}
<table>
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}</td>
<td colspan>{{ trans('unknown') }}</td>
</tr>
{% for i in range(0, 50, 10) %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "height": i }))|raw }}</td>
<td>{{ i }}m</td>
</tr>
{% endfor %}
{% for i in range(100, 250, 50) %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "height": i }))|raw }}</td>
<td>{{ i }}m</td>
</tr>
{% endfor %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "height": "300" }))|raw }}</td>
<td>≥300m</td>
</tr>
</table>
</div>
<div style='display: inline-block'>
{{ tagTrans('building:levels') }}
<table>
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes" }))|raw }}</td>
<td colspan>{{ trans('unknown') }}</td>
</tr>
{% for i in range(0, 12, 3) %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "building:levels": i }))|raw }}</td>
<td>{{ i }}</td>
</tr>
{% endfor %}
{% for i in range(15, 84, 15) %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "building:levels": i }))|raw }}</td>
<td>{{ i }}</td>
</tr>
{% endfor %}
<tr>
<td>{{ markerPolygon(evaluate({ "building": "yes", "building:levels": "85" }))|raw }}</td>
<td>≥85</td>
</tr>
</table>
</div>