-
Notifications
You must be signed in to change notification settings - Fork 11
/
culture-media.yaml
188 lines (175 loc) · 7.48 KB
/
culture-media.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
type: "overpass"
name:
ca: Cultura - Mitjans/Wikidata
en: Culture - Media/Wikidata
fr: Culture - Média/Wikidata
hu: Kultúra – média/Wikidata
it: Cultura - Immagini/Wikidata
pl: Kultura - Media/Wikidane
pt-br: Cultura - Imagem e Wikidata
pt: Cultura - Media/Wikidata
tr: Kültür - Medya/Wikidata
query:
15: |
(
nwr[historic];
nwr[tourism~'^(.*;|)(attraction|artwork)(;.*|)$'];
nwr[heritage];
nwr[amenity~'^(.*;|)(fountain|arts_centre|place_of_worship|theatre)(;.*|)$'];
nwr[man_made~'^(.*;|)(windmill|watermill|bridge|cairn|cross|geoglyph|hongsalmun|iljumun|lighthouse|obelisk|observatory|offshore_platform|paifang|stupa|torii)(;.*|)$'];
nwr[natural=tree][denotation~'^(natural_monument|landmark)$'];
)
feature:
pre: |
{% set cat = 'no' %}
{% set str = null %}
{% if tags.wikidata %}
{% set cat = 'wikidata' %}
{% set wikidata = tags.wikidata|wikidataEntity %}
{% if wikidata and wikidata.claims.P18|length == 0 %}
{% set cat = 'wikidata_no_image' %}
{% endif %}
{% if wikidata.claims.P31[0].mainsnak.datavalue.value.id in ['Q5'] %}
{% set cat = 'wikidata_human' %}
{% endif %}
{% elseif tags.wikipedia %}
{% set cat = 'wikipedia_no_wikidata' %}
{% elseif tags.wikimedia_commons or tags.image %}
{% set cat = 'has_image' %}
{% set str = tags.wikimedia_commons ? 'has wikimedia_commons tag' : 'has image tag' %}
{% endif %}
{% set def = const.categories[cat] %}
exclude: |
{% if filter.category == 'wikidata_no_image' %}
{{ (not wikidata) or (wikidata.claims.P18|length != 0) }}
{% elseif filter.category == 'no_image_or_wikidata_no_image' %}
{{ (tags.wikidata and not wikidata) or (wikidata.claims.P18|length != 0) }}
{% elseif filter.category == 'wikidata_human' %}
{{ wikidata.claims.P31[0].mainsnak.datavalue.value.id not in ['Q5'] }}
{% endif %}
body: |
{{ str|default(def.text) }}
style:
color: |
{{ def.color }}
description: |
{% if tags.historic and tags.historic != 'yes' %}
{{ tagTransList('historic', tags.historic) }}
{% if tags.historic == 'memorial' and tags.memorial %}
({{ tagTransList('memorial', tags.memorial) }})
{% endif %}
{% elseif tags.tourism %}
{{ tagTransList('tourism', tags.tourism) }}
{% elseif tags.amenity %}
{{ tagTransList('amenity', tags.amenity) }}
{% elseif tags.building %}
{{ tags.building == 'yes' ? keyTrans('building') : tagTrans('building', tags.building) }}
{% elseif tags.heritage %}
{{ keyTrans('heritage') }}
{% elseif tags.man_made %}
{{ tagTransList('man_made', tags.man_made) }}
{% elseif tags.natural %}
{{ tagTrans('natural', tags.natural) }} ({{ tagTrans('denotation', tags.denotation) }})
{% endif %}
markerSymbol: "{{ markerPointer({ fillColor: def.color })|raw }}"
listMarkerSymbol: "{{ markerCircle({ fillColor: def.color })|raw }}"
markerSign: |
{% set icon = '' %}
{% for kv, d in const.types|reverse %}
{% set k = kv|split('=')[0] %}
{% set v = kv|split('=')[1] %}
{% if d.icon and v and attribute(tags, k) == v %}
{% set icon = d.icon %}
{% endif %}
{% endfor %}
<span style='color: white;'>{{ icon|raw }}</span>
filter:
type:
name: "{{ trans('filter:type') }}"
show_default: "true"
query: "nwr[{{ value }}]"
type: "select"
key: "tourism"
values: |
{% for kv, d in const.types %}
{% set k = kv|split('=')[0] %}
{% set v = kv|split('=')[1] %}
{% set d = d|default({}) %}
<option value='{{ kv }}' query='nwr[{{ d.query|default(kv) }}]'>{% if d.trans %}{{ trans(d.trans) }}{% elseif not v %}{{ keyTrans(k) }}{% else %}{{ tagTrans(k, v) }}{% endif %}</option>
{% endfor %}
op: "has"
category:
name: "{{ trans('category') }}"
show_default: "true"
type: "select"
values: |
<option value='no' query='nwr[!image][!wikimedia_commons][!wikidata][!wikipedia]'>No image, wikimedia_commons or wikidata</option>
<option value='wikipedia_no_wikidata' query='nwr[!wikidata][wikipedia]'>wikipedia tag found without corresponding wikidata tag</option>
<option value='has_image' query='(nwr[!wikidata][image];nwr[!wikidata][wikimedia_commons];)'>image or wikimedia_commons tag but no wikidata</option>
<option value='wikidata' query='nwr[wikidata]'>has wikidata tag</option>
<option value='wikidata_no_image' query='nwr[wikidata]'>has wikidata tag, but wikidata object does not have an image</option>
<option value='no_image_or_wikidata_no_image' query='(nwr[!image][!wikimedia_commons][!wikidata][!wikipedia];nwr[wikidata];)'>no image/wikimedia_commons OR wikidata without image</option>
<option value='wikidata_human' query='nwr[wikidata]'>wikidata tag points to a human, should most likely be 'subject:wikidata'</option>
info: |
<table>
{% for k, def in const.categories %}
<tr>
<td>
{{ markerCircle({ fillColor: def.color })|raw }}
</td>
<td>{{ def.text }}</td>
</tr>
{% endfor %}
</table>
This category lists artwork, memorials, historic and heritage protected objects. These should have an <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Key:image">image</a> or <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Key:wikimedia_commons">wikimedia_commons</a> tag, or (even better) a <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Key:wikidata">wikidata</a> tag pointing to the object's entry.<br>
Memorials erroneously often have a wikidata (and wikipedia) tag of the person/event, which should be changed to <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Key:wikidata#Secondary_Wikidata_links">subject:wikidata</a> resp. <a target="_blank" href="https://wiki.openstreetmap.org/wiki/Key:wikipedia#Secondary_Wikipedia_links">subject:wikipedia</a>".
const:
types:
tourism=artwork:
icon: '<i class="fas fa-palette"></i>'
tourism=attraction:
icon: '<i class="fas fa-chess"></i>'
historic=memorial:
icon: '<i class="fas fa-monument"></i>'
historic=monument:
icon: '<i class="fas fa-monument"></i>'
historic=wayside_cross:
icon: '<i class="fas fa-cross"></i>'
historic=wayside_shrine:
icon: '<i class="fas fa-vihara"></i>'
historic=building:
icon: '<i class="fas fa-home"></i>'
amenity=fountain:
icon: '<img data-src="temaki:fountain?stroke=white">'
amenity=arts_centre:
icon: '<i class="fas fa-university"></i>'
amenity=place_of_worship:
icon: '<i class="fas fa-place-of-worship"></i>'
amenity=theatre:
icon: '<i class="fas fa-theater-masks"></i>'
natural=tree:
icon: '<i class="fas fa-tree"></i>'
heritage:
man_made:
other:
query: 'nwr[historic][historic!~"^(memorial|monument|wayside_cross|wayside_shrine|building)$"]'
trans: 'other'
categories:
'no':
color: red
text: No image, wikimedia_commons or wikidata
has_image:
color: cyan
text: image or wikimedia_commons tag but no wikidata
wikidata_no_image:
color: '#007fff'
text: has wikidata tag, but wikidata object does not have an image
wikidata:
color: blue
text: has wikidata tag
wikidata_human:
color: magenta
text: wikidata tag points to a human, should most likely be 'subject:wikidata'
wikipedia_no_wikidata:
color: '#af00ff'
text: wikipedia tag found without corresponding wikidata tag