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.

54 lines
2.0 KiB

  1. {
  2. "type": "overpass",
  3. "name": {
  4. "en": "Maxspeed"
  5. },
  6. "query": {
  7. "11": "way[highway~\"^(motorway|trunk)$\"];",
  8. "15": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified)$\"];",
  9. "13": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|tertiary)$\"];",
  10. "17": "way[highway~\"^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|residential|unclassified|service|living_street|pedestrian|track|road)$\"];"
  11. },
  12. "feature": {
  13. "pre": [
  14. "{% if tags.maxspeed is not defined %}",
  15. "{% set maxspeedKmh = null %}",
  16. "{% set maxspeed = null %}",
  17. "{% set unit = null %}",
  18. "{% else %}",
  19. "",
  20. "{% if tags.maxspeed|matches(\"^[0-9]+$\") %}",
  21. "{% set maxspeedKmh = tags.maxspeed %}",
  22. "{% set maxspeed = tags.maxspeed %}",
  23. "{% set unit = \"km/h\" %}",
  24. "{% endif %}",
  25. "",
  26. "",
  27. "{% set m = tags.maxspeed|matches(\"(^[0-9]+) mph$\") %}",
  28. "{% if m %}",
  29. "{% set maxspeedKmh = m[1] * 1.60934 %}",
  30. "{% set maxspeed = m[1] %}",
  31. "{% set unit = \"mph\" %}",
  32. "{% endif %}",
  33. "",
  34. "{% endif %}",
  35. "",
  36. "{% if not maxspeedKmh %}",
  37. "{% set color = \"#404040\" %}",
  38. "{% else %}",
  39. "{% set color = colorInterpolate([ 'green', 'orange', 'red' ], maxspeedKmh / 150) %}",
  40. "{% endif %}"
  41. ],
  42. "description": [
  43. "{% if maxspeed %}",
  44. "<span style='color: {{ color }}'>{{ maxspeed }} {{ unit }}</span>",
  45. "{% else %}",
  46. "{{ trans('unknown') }}",
  47. "{% endif %}"
  48. ],
  49. "style": {
  50. "color": "{{ color }}"
  51. },
  52. "markerSign": null
  53. }
  54. }