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.

43 lines
4.1 KiB

7 years ago
7 years ago
  1. {
  2. "type": "overpass",
  3. "name": {
  4. "de": "Eisenbahn Elektrifizierung",
  5. "en": "Railway electrification"
  6. },
  7. "query": {
  8. "11": "way[railway=rail][railway!~'^(platform|abandoned|disused|station|proposed)$'][usage~'^(main|branch)$'];",
  9. "14": "way[railway][railway!~'^(platform|abandoned|disused|station|proposed)$'];"
  10. },
  11. "feature": {
  12. "pre": "{% if tags.electrified and tags.electrified != 'no' %}\n {% if tags.voltage < 1000 %}\n {% set color = colorInterpolate([ '#00ff00', 'blue' ], tags.voltage / 1000) %}\n {% else %}\n {% set color = colorInterpolate([ 'blue', 'red' ], (tags.voltage - 1000) / 24000) %}\n {% endif %}\n{% else %}\n {% set color='black' %}\n{%endif %}\n\n{% if tags.service == 'yard' or tags.service == 'siding' or tags.service == 'spur' or tags.service == 'crossover' %}\n {% set weight=2 %}\n {% else %}\n {% if tags.railway == 'rail' %}\n {% if tags.usage == 'main' or tags.usage == 'branch' %}\n {% set weight=3 %}\n {% else %}\n {% set weight=2.5 %}\n {% endif %}\n {% else %}\n {% set weight=2 %}\n {% endif %}\n{% endif %}",
  13. "style:casing": {
  14. "weight": "{{ weight + 2 }}",
  15. "color": "{{ color }}",
  16. "dashArray": "2,4",
  17. "lineCap": "butt"
  18. },
  19. "style": {
  20. "color": "white",
  21. "weight": "{{ weight }}",
  22. "fill": null,
  23. "opacity": "1"
  24. },
  25. "style:highlight": {
  26. "color": "{{ color }}",
  27. "weight": "{{ weight }}",
  28. "dashArray": "{% if not tags.electrified or tags.electrified == 'no' %}\n{% elseif tags.frequency == 0 %}\n{% else %}\n5,2\n{% endif %}",
  29. "fillColor": "{% if tags.railway == 'platform' %}#3f3f3f{% endif %}",
  30. "fill": "{% if tags.railway == 'platform' %}1{% else %}{% endif %}",
  31. "opacity": "1",
  32. "lineCap": "butt"
  33. },
  34. "styles": "{% if tags.railway == 'narrow_gauge' %}default,casing,highlight{% else %}default,highlight{% endif %}",
  35. "markerSign": null,
  36. "body": "{{ tagTrans('railway', tags.railway) }}<br/>\n{% if tags.operator %}{{ keyTrans('operator') }}: {{ localizedTag(tags, 'operator') }}<br>{% endif %}\n{% if tags.usage %}{{ keyTrans('usage') }}: {{ tagTrans('usage', tags.usage)|default(trans('unknown')) }}<br/>{% endif %}\n{% if tags.service %}{{ keyTrans('service') }}: {{ tagTrans('service', tags.service ) }}<br/>{% endif %}\n{{ keyTrans('gauge') }}: {{ tags.gauge|default(trans('unknown')) }}<br/>\n{% if tags.electrified == 'no' %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', 'no') }}{% elseif tags.electrified %}{{ keyTrans('electrified') }}: {{ tagTrans('electrified', tags.electrified) }}, {{ keyTrans('voltage') }}: {{ tags.voltage|default(trans('unknown')) }}, {{ keyTrans('frequency') }}: {{ tags.frequency|default(trans('unknown')) }}<br/>{% endif %}\n",
  37. "description": "{{ tagTrans('railway', tags.railway) }} -\n\n{% if tags.electrified == 'no' %}\n {{ trans('not electrified') }}\n{% elseif tags.electrified %}\n {{ tags.voltage|default(trans('unknown')) }}V, {{ tags.frequency|default(trans('unknown')) }}Hz\n{% endif %}",
  38. "priority": "{% if tags.railway == 'station' %}0{% elseif tags.railway in [ 'halt', 'tram_stop' ] %}1{% else %}5{% endif %}",
  39. "title": "{% if tags.ref %}{{ localizedTag(tags, 'ref') }} - {% endif %}{{ localizedTag(tags, 'name')|default(localizedTag(tags, 'operator'))|default(trans('unnamed')) }}",
  40. "listMarkerSymbol": "{{ markerLine({ 'weight': 3, 'color': color })|raw }}"
  41. },
  42. "info": "<table>\n{% for i in range(0, 1000, 200) %}\n {% set color = colorInterpolate([ '#00ff00', 'blue' ], i / 1000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n\n{% for i in range(3000, 25000, 2000) %}\n {% set color = colorInterpolate([ 'blue', 'red' ], (i - 1000) / 24000) %}\n <tr>\n <td>{{ markerLine({ 'weight': 3, 'color': color })|raw }}</td>\n <td>{{ i }}V</td>\n </tr>\n{% endfor %}\n</table>"
  43. }