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.

197 lines
7.8 KiB

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