forked from plepe/openstreetbrowser-categories-main
-
Notifications
You must be signed in to change notification settings - Fork 0
/
car_maxspeed.json
113 lines (113 loc) · 3.92 KB
/
car_maxspeed.json
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
{
"type": "overpass",
"name": {
"de": "Höchstgeschwindigkeiten",
"en": "Maxspeed",
"fr": "Limites de vitesse"
},
"query": {
"11": "way[highway~\"^(motorway|trunk)$\"];",
"13": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$\"];",
"15": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$\"];",
"17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];"
},
"feature": {
"pre": [
"{% if tags.maxspeed is not defined %}",
"{% set maxspeedKmh = null %}",
"{% set maxspeed = null %}",
"{% set unit = null %}",
"{% else %}",
"",
"{% if tags.maxspeed|matches(\"^[0-9]+$\") %}",
"{% set maxspeedKmh = tags.maxspeed %}",
"{% set maxspeed = tags.maxspeed %}",
"{% set unit = \"km/h\" %}",
"{% endif %}",
"",
"",
"{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
"{% if m %}",
"{% set maxspeedKmh = m[1] * 1.60934 %}",
"{% set maxspeed = m[1] %}",
"{% set unit = \"mph\" %}",
"{% endif %}",
"",
"{% endif %}",
"",
"{% if not maxspeedKmh %}",
"{% set color = \"#404040\" %}",
"{% else %}",
"{% set color = colorInterpolate(const.colorMap, (maxspeedKmh - const.offsetColorSpeed) / const.highestColorSpeed) %}",
"{% endif %}"
],
"description": [
"{% if maxspeed %}",
"<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>",
"{% elseif tags.maxspeed %}",
"{{ tags.maxspeed }}",
"{% else %}",
"{{ trans('unknown') }}",
"{% endif %}"
],
"markerSymbol": null,
"listMarkerSymbol": "line",
"style": {
"width": "3",
"color": "{{ color }}"
}
},
"const": {
"colorMap": [
"#00af00",
"#ff7f00",
"#ff0000",
"#af00af"
],
"highestColorSpeed": 150,
"offsetColorSpeed": 10
},
"info": [
"<div style='display: inline-block'>",
"<table>",
" <tr>",
" <td>{{ markerLine(evaluate({}))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
"{% for i in range(10, 140, 20) %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": i }))|raw }}</td>",
" <td>{{ i }}km/h</td>",
" </tr>",
"{% endfor %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": 150 }))|raw }}</td>",
" <td>≥150km/h</td>",
" </tr>",
"</table>",
"</div>",
"",
"<div style='display: inline-block'>",
"<table>",
" <tr>",
" <td>{{ markerLine(evaluate({}))|raw }}</td>",
" <td colspan>{{ trans('unknown') }}</td>",
" </tr>",
"{% for i in range(10, 60, 10) %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": (i * 1.60934)|round }))|raw }}</td>",
" <td>{{ i }}mph</td>",
" </tr>",
"{% endfor %}",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": (75 * 1.60934)|round }))|raw }}</td>",
" <td>75mph</td>",
" </tr>",
" <tr>",
" <td>{{ markerLine(evaluate({ \"maxspeed\": (95 * 1.60934)|round }))|raw }}</td>",
" <td>≥95mph</td>",
" </tr>",
"</table>",
"</div>"
]
}