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.

193 lines
7.9 KiB

7 years ago
7 years ago
7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "ÖV Karte",
  5. "en": "Public transport map"
  6. },
  7. "query": {
  8. "12": "relation[type=route][route~\"^(subway|monorail|ferry|train)$\"];",
  9. "14": [
  10. "(",
  11. "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];",
  12. "relation[type=public_transport][public_transport=stop_area];",
  13. ")"
  14. ]
  15. },
  16. "lists": {
  17. "stops": {
  18. "prefix": "listStops",
  19. "name": {
  20. "ast": "Paraes y estaciones",
  21. "cs": "Zastávky & Stanice",
  22. "de": "Haltestellen",
  23. "el": "Στάσεις & Σταθμοί",
  24. "en": "Stops & Stations",
  25. "es": "Paradas y estaciones",
  26. "fr": "Arrêts/Stops, Stations",
  27. "hu": "Megállók és állomások",
  28. "it": "Stazioni e fermate",
  29. "ja": "停留所と駅",
  30. "nl": "Haltes en Stations",
  31. "pl": "Przystanki i Stacje",
  32. "pt-br": "Paradas e Estações",
  33. "ru": "Остановки и станции",
  34. "uk": "Зупинки та станції"
  35. }
  36. },
  37. "routes": {
  38. "prefix": "listRoutes",
  39. "name": {
  40. "de": "Routen",
  41. "en": "Routes",
  42. "fr": "Lignes",
  43. "pt": "Rotas",
  44. "pt-br": "Rotas"
  45. }
  46. }
  47. },
  48. "feature": {
  49. "pre": "{% set isStopArea = tags.public_transport == 'stop_area' %}",
  50. "title": [
  51. "{% if tags.ref %}{{ tags.ref }} - {% endif %}",
  52. "",
  53. "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}"
  54. ],
  55. "description": "{{ tagTrans('route', tags.route) }}",
  56. "body": [
  57. "<h4>Stops</h4><ul>",
  58. "{% for member in members %}",
  59. "{% if member.tags.highway == 'bus_stop' or member.tags.amenity == 'bus_station' or member.tags.amenity == 'ferry_terminal' or member.tags.railway == 'tram_stop' or member.tags.railway == 'halt' or member.tags.railway == 'station' or member.tags.aerialway == 'station' or member.tags.public_transport == 'stop_position' or member.role|slice(-4) == 'stop' %}",
  60. "<li data-object='{{ member.id }}' data-sublayer='member'><b>{{ member.tags.name|default(member.id) }}</li>",
  61. "{% endif %}",
  62. "{% endfor %}",
  63. "</ul>"
  64. ],
  65. "markerSymbol": "",
  66. "styles": "",
  67. "listStopsExclude": "true",
  68. "listRoutesMarkerSign": "{{ const[tags.route].sign|raw }}",
  69. "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}",
  70. "listRoutesExclude": "{{ isStopArea }}"
  71. },
  72. "members": true,
  73. "memberFeature": {
  74. "pre": [
  75. "{% set stopName = '' %}",
  76. "{% set isStop = false %}",
  77. "{% set stopCount = 0 %}",
  78. "{% if tags.highway == 'bus_stop' or tags.amenity == 'bus_station' or tags.amenity == 'ferry_terminal' or tags.railway == 'tram_stop' or tags.railway == 'halt' or tags.railway == 'station' or tags.aerialway == 'station' or tags.public_transport == 'stop_position' %}{% set isStop = true %}{% endif %}",
  79. "{% set isWay = false %}",
  80. "{% set aRoute = null %}",
  81. "{% set refs = [] %}",
  82. "{% for master in masters %}",
  83. " {% if master.tags.public_transport == 'stop_area' %}",
  84. " {% set stopName = master.tags.name %}",
  85. " {% else %}",
  86. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  87. " {% set isStop = true %}",
  88. " {% set stopCount = stopCount + 1 %}",
  89. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  90. " {% set isWay = true %}",
  91. " {% endif %}",
  92. " {% set aRoute = master %}",
  93. "",
  94. " {% if master.tags.ref %}",
  95. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  96. " {% endif %}",
  97. " {% endif %}",
  98. "{% endfor %}",
  99. "",
  100. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  101. "{% set color = const[aRoute.tags.route].color %}"
  102. ],
  103. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  104. "body": [
  105. "<h4>Routes</h4>",
  106. "<ul class='overpass-layer-list'>",
  107. "{% for master in masters %}",
  108. " {% if master.tags.public_transport != 'stop_area' %}",
  109. " <li data-object=\"{{ master.id }}\">",
  110. " <span class='markerParent'><div class='marker'>{{ markerCircle({fillColor:const[master.tags.route].color})|raw }}</div><div class='icon'>{{ const[master.tags.route].sign|raw }}</div></span>",
  111. " <span class='title'>{% if master.tags.ref and master.tags.name %}{{ master.tags.ref }} - {{ master.tags.name|default(master.tags.ref) }}{% elseif master.tags.ref %}{{ master.tags.ref }}{% elseif master.tags.name %}{{ master.tags.name }}{% else %}{{ trans('unnamed') }}{% endif %}</span>",
  112. " <span class='description'>{{ tagTrans('route', master.tags.route) }}</span>",
  113. " </li>",
  114. " {% endif %}",
  115. "{% endfor %}",
  116. "</ul>"
  117. ],
  118. "styles": "{% if isStop and stopCount > 0 %}stop{% elseif isWay %}way{% else %}{% endif %}",
  119. "listStopsMarkerSign": null,
  120. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  121. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  122. "listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}",
  123. "listStopsDescription": "{{ refs|join(' ') }}",
  124. "listRoutesExclude": "true",
  125. "style:way": {
  126. "width": "3",
  127. "color": "{{ color|default('#ff0000') }}",
  128. "text": "{{ refs|join(' ') }} ",
  129. "textRepeat": "1",
  130. "textOffset": "12",
  131. "textFontWeight": "bold"
  132. },
  133. "style:stop": {
  134. "width": "5",
  135. "color": "{{ color|default('#ff0000') }}",
  136. "radius": "3"
  137. }
  138. },
  139. "info": [
  140. "<table>",
  141. "{% for value, data in const %}",
  142. "{% if data.zoom <= map.zoom %}",
  143. " <tr>",
  144. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  145. " <td>{{ tagTrans('route', value) }}</td>",
  146. " </tr>",
  147. "{% endif %}",
  148. "{% endfor %}",
  149. "</table>"
  150. ],
  151. "const": {
  152. "train": {
  153. "sign": "<img src='maki:rail?fill=#ffffff'>",
  154. "zoom": 12,
  155. "color": "#00007f"
  156. },
  157. "subway": {
  158. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  159. "zoom": 12,
  160. "color": "#0000ff"
  161. },
  162. "monorail": {
  163. "sign": "<span style='color: #ffffff'>M</span>",
  164. "zoom": 12,
  165. "color": "#006f8f"
  166. },
  167. "tram": {
  168. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  169. "zoom": 12,
  170. "color": "#7f007f"
  171. },
  172. "bus": {
  173. "sign": "<img src='maki:bus?fill=#ffffff'>",
  174. "zoom": 12,
  175. "color": "#af0000"
  176. },
  177. "trolleybus": {
  178. "sign": "<img src='maki:bus?fill=#ffffff'>",
  179. "zoom": 12,
  180. "color": "#af3f00"
  181. },
  182. "aerialway": {
  183. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  184. "zoom": 12,
  185. "color": "#00aaaa"
  186. },
  187. "ferry": {
  188. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  189. "zoom": 12,
  190. "color": "#007fff"
  191. }
  192. }
  193. }