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.

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