Main categories of OpenStreetBrowser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
6.6 KiB

  1. type: "overpass"
  2. query:
  3. 15: |
  4. (
  5. nwr[historic];
  6. nwr[tourism~'^(attraction|artwork)$'];
  7. nwr[heritage];
  8. nwr[amenity~'^(fountain|arts_centre|place_of_worship|theatre)$'];
  9. )
  10. feature:
  11. pre: |
  12. {% set cat = 'no' %}
  13. {% set str = null %}
  14. {% if tags.wikidata %}
  15. {% set cat = 'wikidata' %}
  16. {% set wikidata = tags.wikidata|wikidataEntity %}
  17. {% if wikidata and wikidata.claims.P18|length == 0 %}
  18. {% set cat = 'wikidata_no_image' %}
  19. {% endif %}
  20. {% if wikidata.claims.P31[0].mainsnak.datavalue.value.id in ['Q5'] %}
  21. {% set cat = 'wikidata_human' %}
  22. {% endif %}
  23. {% elseif tags.wikipedia %}
  24. {% set cat = 'wikipedia_no_wikidata' %}
  25. {% elseif tags.wikimedia_commons or tags.image %}
  26. {% set cat = 'has_image' %}
  27. {% set str = tags.wikimedia_commons ? 'has wikimedia_commons tag' : 'has image tag' %}
  28. {% endif %}
  29. {% set def = const.categories[cat] %}
  30. exclude: |
  31. {% if filter.category == 'wikidata_no_image' %}
  32. {{ (not wikidata) or (wikidata.claims.P18|length != 0) }}
  33. {% elseif filter.category == 'no_image_or_wikidata_no_image' %}
  34. {{ (tags.wikidata and not wikidata) or (wikidata.claims.P18|length != 0) }}
  35. {% elseif filter.category == 'wikidata_human' %}
  36. {{ wikidata.claims.P31[0].mainsnak.datavalue.value.id not in ['Q5'] }}
  37. {% endif %}
  38. body: |
  39. {{ str|default(def.text) }}
  40. style:
  41. color: |
  42. {{ def.color }}
  43. description: |
  44. {% if tags.historic and tags.historic != 'yes' %}
  45. {{ tagTransList('historic', tags.historic) }}
  46. {% if tags.historic == 'memorial' and tags.memorial %}
  47. ({{ tagTransList('memorial', tags.memorial) }})
  48. {% endif %}
  49. {% elseif tags.tourism %}
  50. {{ tagTransList('tourism', tags.tourism) }}
  51. {% elseif tags.amenity %}
  52. {{ tagTrans('amenity', tags.amenity) }}
  53. {% elseif tags.building %}
  54. {{ tags.building == 'yes' ? keyTrans('building') : tagTrans('building', tags.building) }}
  55. {% elseif tags.heritage %}
  56. {{ keyTrans('heritage') }}
  57. {% endif %}
  58. markerSymbol: "{{ markerPointer({ fillColor: def.color })|raw }}"
  59. listMarkerSymbol: "{{ markerCircle({ fillColor: def.color })|raw }}"
  60. markerSign: |
  61. {% set icon = '' %}
  62. {% for kv, d in const.types|reverse %}
  63. {% set k = kv|split('=')[0] %}
  64. {% set v = kv|split('=')[1] %}
  65. {% if d.icon and v and attribute(tags, k) == v %}
  66. {% set icon = d.icon %}
  67. {% endif %}
  68. {% endfor %}
  69. <span style='color: white;'>{{ icon|raw }}</span>
  70. filter:
  71. type:
  72. name: "{{ trans('filter:type') }}"
  73. show_default: "true"
  74. query: "nwr[{{ value }}]"
  75. type: "select"
  76. key: "tourism"
  77. values: |
  78. {% for kv, d in const.types %}
  79. {% set k = kv|split('=')[0] %}
  80. {% set v = kv|split('=')[1] %}
  81. {% set d = d|default({}) %}
  82. <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>
  83. {% endfor %}
  84. op: "has"
  85. category:
  86. name: "{{ trans('category') }}"
  87. show_default: "true"
  88. type: "select"
  89. values: |
  90. <option value='no' query='nwr[!image][!wikimedia_commons][!wikidata][!wikipedia]'>No image, wikimedia_commons or wikidata</option>
  91. <option value='wikipedia_no_wikidata' query='nwr[!wikidata][wikipedia]'>wikipedia tag found without corresponding wikidata tag</option>
  92. <option value='has_image' query='(nwr[!wikidata][image];nwr[!wikidata][wikimedia_commons];)'>image or wikimedia_commons tag but no wikidata</option>
  93. <option value='wikidata' query='nwr[wikidata]'>has wikidata tag</option>
  94. <option value='wikidata_no_image' query='nwr[wikidata]'>has wikidata tag, but wikidata object does not have an image</option>
  95. <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>
  96. <option value='wikidata_human' query='nwr[wikidata]'>wikidata tag points to a human, should most likely be 'subject:wikidata'</option>
  97. info: |
  98. <table>
  99. {% for k, def in const.categories %}
  100. <tr>
  101. <td>
  102. {{ markerCircle({ fillColor: def.color })|raw }}
  103. </td>
  104. <td>{{ def.text }}</td>
  105. </tr>
  106. {% endfor %}
  107. </table>
  108. 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>
  109. 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>".
  110. const:
  111. types:
  112. tourism=artwork:
  113. icon: '<i class="fas fa-palette"></i>'
  114. tourism=attraction:
  115. icon: '<i class="fas fa-chess"></i>'
  116. historic=memorial:
  117. icon: '<i class="fas fa-monument"></i>'
  118. historic=monument:
  119. icon: '<i class="fas fa-monument"></i>'
  120. historic=wayside_cross:
  121. icon: '<i class="fas fa-cross"></i>'
  122. historic=wayside_shrine:
  123. icon: '<i class="fas fa-vihara"></i>'
  124. historic=building:
  125. icon: '<i class="fas fa-home"></i>'
  126. amenity=fountain:
  127. icon: '<img data-src="temaki:fountain?stroke=white">'
  128. amenity=arts_centre:
  129. icon: '<i class="fas fa-university"></i>'
  130. amenity=place_of_worship:
  131. icon: '<i class="fas fa-place-of-worship"></i>'
  132. amenity=theatre:
  133. icon: '<i class="fas fa-theater-masks"></i>'
  134. heritage:
  135. other:
  136. query: 'nwr[historic][historic!~"^(memorial|monument|wayside_cross|wayside_shrine|building)$"]'
  137. trans: 'other'
  138. categories:
  139. 'no':
  140. color: red
  141. text: No image, wikimedia_commons or wikidata
  142. has_image:
  143. color: cyan
  144. text: image or wikimedia_commons tag but no wikidata
  145. wikidata_no_image:
  146. color: '#007fff'
  147. text: has wikidata tag, but wikidata object does not have an image
  148. wikidata:
  149. color: blue
  150. text: has wikidata tag
  151. wikidata_human:
  152. color: magenta
  153. text: wikidata tag points to a human, should most likely be 'subject:wikidata'
  154. wikipedia_no_wikidata:
  155. color: '#af00ff'
  156. text: wikipedia tag found without corresponding wikidata tag