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.

194 lines
8.0 KiB

6 years ago
6 years ago
6 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "ÖV Karte",
  5. "en": "Public transport map",
  6. "pt-br": "Mapa de transporte público"
  7. },
  8. "query": {
  9. "12": "relation[type=route][route~\"^(subway|monorail|ferry|train)$\"];",
  10. "14": [
  11. "(",
  12. "relation[type=route][route~\"^(subway|monorail|aerialway|bus|trolleybus|ferry|train|tram)$\"];",
  13. "relation[type=public_transport][public_transport=stop_area];",
  14. ")"
  15. ]
  16. },
  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. "title": [
  52. "{% if tags.ref %}{{ tags.ref }} - {% endif %}",
  53. "",
  54. "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}"
  55. ],
  56. "description": "{{ tagTrans('route', tags.route) }}",
  57. "body": [
  58. "<h4>Stops</h4><ul>",
  59. "{% for member in members %}",
  60. "{% 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' %}",
  61. "<li data-object='{{ member.id }}' data-sublayer='member'><b>{{ member.tags.name|default(member.id) }}</li>",
  62. "{% endif %}",
  63. "{% endfor %}",
  64. "</ul>"
  65. ],
  66. "markerSymbol": "",
  67. "styles": "",
  68. "listStopsExclude": "true",
  69. "listRoutesMarkerSign": "{{ const[tags.route].sign|raw }}",
  70. "listRoutesMarkerSymbol": "{{ markerCircle({fillColor:const[tags.route].color})|raw }}",
  71. "listRoutesExclude": "{{ isStopArea }}"
  72. },
  73. "members": true,
  74. "memberFeature": {
  75. "pre": [
  76. "{% set stopName = '' %}",
  77. "{% set isStop = false %}",
  78. "{% set stopCount = 0 %}",
  79. "{% 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 %}",
  80. "{% set isWay = false %}",
  81. "{% set aRoute = null %}",
  82. "{% set refs = [] %}",
  83. "{% for master in masters %}",
  84. " {% if master.tags.public_transport == 'stop_area' %}",
  85. " {% set stopName = master.tags.name %}",
  86. " {% else %}",
  87. " {% if master.role|matches('^(|.*stop)$') and isStop %}",
  88. " {% set isStop = true %}",
  89. " {% set stopCount = stopCount + 1 %}",
  90. " {% elseif master.role|matches('^(|forward|backward)$') and type == 'way' %}",
  91. " {% set isWay = true %}",
  92. " {% endif %}",
  93. " {% set aRoute = master %}",
  94. "",
  95. " {% if master.tags.ref %}",
  96. " {% set refs = refs|merge([ master.tags.ref ]) %}",
  97. " {% endif %}",
  98. " {% endif %}",
  99. "{% endfor %}",
  100. "",
  101. "{% set refs = refs|unique|natsort({ insensitive: true }) %}",
  102. "{% set color = const[aRoute.tags.route].color %}"
  103. ],
  104. "title": "{% if isStop %}{{ tags.name|default(stopName)|default(id) }}{% endif %}",
  105. "body": [
  106. "<h4>Routes</h4>",
  107. "<ul class='overpass-layer-list'>",
  108. "{% for master in masters %}",
  109. " {% if master.tags.public_transport != 'stop_area' %}",
  110. " <li data-object=\"{{ master.id }}\">",
  111. " <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>",
  112. " <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>",
  113. " <span class='description'>{{ tagTrans('route', master.tags.route) }}</span>",
  114. " </li>",
  115. " {% endif %}",
  116. "{% endfor %}",
  117. "</ul>"
  118. ],
  119. "styles": "{% if isStop and stopCount > 0 %}stop{% elseif isWay %}way{% else %}{% endif %}",
  120. "listStopsMarkerSign": null,
  121. "listStopsMarkerSymbol": "{{ markerCircle({ width: 5, color: color, fillOpacity: '1', radius: 3 })|raw }}",
  122. "listStopsExclude": "{{ not isStop or stopCount == 0 }}",
  123. "listStopsTitle": "{{ tags.name|default(stopName)|default(id) }}",
  124. "listStopsDescription": "{{ refs|join(' ') }}",
  125. "listRoutesExclude": "true",
  126. "style:way": {
  127. "width": "3",
  128. "color": "{{ color|default('#ff0000') }}",
  129. "text": "{{ refs|join(' ') }} ",
  130. "textRepeat": "1",
  131. "textOffset": "12",
  132. "textFontWeight": "bold"
  133. },
  134. "style:stop": {
  135. "width": "5",
  136. "color": "{{ color|default('#ff0000') }}",
  137. "radius": "3"
  138. }
  139. },
  140. "info": [
  141. "<table>",
  142. "{% for value, data in const %}",
  143. "{% if data.zoom <= map.zoom %}",
  144. " <tr>",
  145. " <td>{{ markerCircle({fillColor:data.color})|raw }}<div class='sign'>{{ data.sign|raw }}</div></td>",
  146. " <td>{{ tagTrans('route', value) }}</td>",
  147. " </tr>",
  148. "{% endif %}",
  149. "{% endfor %}",
  150. "</table>"
  151. ],
  152. "const": {
  153. "train": {
  154. "sign": "<img src='maki:rail?fill=#ffffff'>",
  155. "zoom": 12,
  156. "color": "#00007f"
  157. },
  158. "subway": {
  159. "sign": "<img src='maki:rail-metro?fill=#ffffff'>",
  160. "zoom": 12,
  161. "color": "#0000ff"
  162. },
  163. "monorail": {
  164. "sign": "<span style='color: #ffffff'>M</span>",
  165. "zoom": 12,
  166. "color": "#006f8f"
  167. },
  168. "tram": {
  169. "sign": "<img src='maki:rail-light?fill=#ffffff'>",
  170. "zoom": 12,
  171. "color": "#7f007f"
  172. },
  173. "bus": {
  174. "sign": "<img src='maki:bus?fill=#ffffff'>",
  175. "zoom": 12,
  176. "color": "#af0000"
  177. },
  178. "trolleybus": {
  179. "sign": "<img src='maki:bus?fill=#ffffff'>",
  180. "zoom": 12,
  181. "color": "#af3f00"
  182. },
  183. "aerialway": {
  184. "sign": "<img src='maki:aerialway?fill=#ffffff'>",
  185. "zoom": 12,
  186. "color": "#00aaaa"
  187. },
  188. "ferry": {
  189. "sign": "<img src='maki:ferry?fill=#ffffff'>",
  190. "zoom": 12,
  191. "color": "#007fff"
  192. }
  193. }
  194. }