From 24dee35d65dbca131f23b5d181ab76941f2e3355 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sat, 27 Oct 2018 20:38:53 +0200
Subject: [PATCH] New category: power routes

---
 index.json         |  3 +++
 lang/ast.json      |  1 +
 lang/ca.json       |  1 +
 lang/cs.json       |  1 +
 lang/de.json       |  1 +
 lang/el.json       |  1 +
 lang/en.json       |  1 +
 lang/es.json       |  1 +
 lang/et.json       |  1 +
 lang/fr.json       |  1 +
 lang/hu.json       |  1 +
 lang/it.json       |  1 +
 lang/ja.json       |  1 +
 lang/nl.json       |  1 +
 lang/pl.json       |  1 +
 lang/pt-br.json    |  1 +
 lang/pt.json       |  1 +
 lang/ro.json       |  1 +
 lang/ru.json       |  1 +
 lang/template.json |  1 +
 lang/uk.json       |  1 +
 power_routes.json  | 63 ++++++++++++++++++++++++++++++++++++++++++++++
 22 files changed, 86 insertions(+)
 create mode 100644 power_routes.json

diff --git a/index.json b/index.json
index 2fbd6b8..e7b6bc0 100644
--- a/index.json
+++ b/index.json
@@ -260,6 +260,9 @@
                         {
                             "id": "electric_power"
                         },
+                        {
+                            "id": "power_routes"
+                        },
                         {
                             "id": "coal"
                         },
diff --git a/lang/ast.json b/lang/ast.json
index a5e172f..0f66d31 100644
--- a/lang/ast.json
+++ b/lang/ast.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Llugares",
     "category:playgrounds": "Xuegos infantiles",
     "category:post": "Corréu",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Paraes y estaciones",
diff --git a/lang/ca.json b/lang/ca.json
index 9a95a3e..3fd3e7d 100644
--- a/lang/ca.json
+++ b/lang/ca.json
@@ -44,6 +44,7 @@
     "category:places_geo": "",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "",
diff --git a/lang/cs.json b/lang/cs.json
index 316a8e5..b6e8cfe 100644
--- a/lang/cs.json
+++ b/lang/cs.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Sídla",
     "category:playgrounds": "Hřiště",
     "category:post": "Poštovní služby",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Zastávky & Stanice",
diff --git a/lang/de.json b/lang/de.json
index 2a77009..467fec3 100644
--- a/lang/de.json
+++ b/lang/de.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Orte",
     "category:playgrounds": "Spielplätze",
     "category:post": "Post",
+    "category:power_routes": "",
     "category:pt": "ÖV Karte",
     "category:pt:routes": "Routen",
     "category:pt:stops": "Haltestellen",
diff --git a/lang/el.json b/lang/el.json
index 97c3dc6..ff8f645 100644
--- a/lang/el.json
+++ b/lang/el.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Μέρη",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Στάσεις & Σταθμοί",
diff --git a/lang/en.json b/lang/en.json
index 153aea4..6966220 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Places",
     "category:playgrounds": "Playground",
     "category:post": "Post",
+    "category:power_routes": "Power routes",
     "category:pt": "Public transport map",
     "category:pt:routes": "Routes",
     "category:pt:stops": "Stops & Stations",
diff --git a/lang/es.json b/lang/es.json
index b13fced..4af85d5 100644
--- a/lang/es.json
+++ b/lang/es.json
@@ -44,6 +44,7 @@
     "category:places_geo": "",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Paradas y estaciones",
diff --git a/lang/et.json b/lang/et.json
index e647441..9bbb3c5 100644
--- a/lang/et.json
+++ b/lang/et.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Kohad",
     "category:playgrounds": "Mänguväljak",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "",
diff --git a/lang/fr.json b/lang/fr.json
index 784d81c..fb9798c 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Lieux",
     "category:playgrounds": "Jeux pour enfants",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "Lignes",
     "category:pt:stops": "Arrêts/Stops, Stations",
diff --git a/lang/hu.json b/lang/hu.json
index a673480..7239711 100644
--- a/lang/hu.json
+++ b/lang/hu.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Helyek",
     "category:playgrounds": "Játszóterek",
     "category:post": "Posta",
+    "category:power_routes": "",
     "category:pt": "Tömegközlekedési térkép",
     "category:pt:routes": "Útvonalak",
     "category:pt:stops": "Megállók és állomások",
diff --git a/lang/it.json b/lang/it.json
index 1e54cd3..69663bb 100644
--- a/lang/it.json
+++ b/lang/it.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Luoghi",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Stazioni e fermate",
diff --git a/lang/ja.json b/lang/ja.json
index 6f92a3b..883490c 100644
--- a/lang/ja.json
+++ b/lang/ja.json
@@ -44,6 +44,7 @@
     "category:places_geo": "場所",
     "category:playgrounds": "",
     "category:post": "郵便",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "停留所と駅",
diff --git a/lang/nl.json b/lang/nl.json
index a7ca08e..c1902e3 100644
--- a/lang/nl.json
+++ b/lang/nl.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Plaatsen",
     "category:playgrounds": "",
     "category:post": "Post",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Haltes en Stations",
diff --git a/lang/pl.json b/lang/pl.json
index fbce3f3..bf6258e 100644
--- a/lang/pl.json
+++ b/lang/pl.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Miejsca",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Przystanki i Stacje",
diff --git a/lang/pt-br.json b/lang/pt-br.json
index e0fa41f..aded34d 100644
--- a/lang/pt-br.json
+++ b/lang/pt-br.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Lugares",
     "category:playgrounds": "Parquinhos",
     "category:post": "Correios",
+    "category:power_routes": "",
     "category:pt": "Mapa de transporte público",
     "category:pt:routes": "Rotas",
     "category:pt:stops": "Paradas e estações",
diff --git a/lang/pt.json b/lang/pt.json
index 64314ad..9a16662 100644
--- a/lang/pt.json
+++ b/lang/pt.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Lugares",
     "category:playgrounds": "Parques infantis",
     "category:post": "Correios",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "Rotas",
     "category:pt:stops": "",
diff --git a/lang/ro.json b/lang/ro.json
index 827c329..4649196 100644
--- a/lang/ro.json
+++ b/lang/ro.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Locuri",
     "category:playgrounds": "Loc de joaca",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "",
diff --git a/lang/ru.json b/lang/ru.json
index 57ed500..e4f125f 100644
--- a/lang/ru.json
+++ b/lang/ru.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Места",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Остановки и станции",
diff --git a/lang/template.json b/lang/template.json
index 39c78d3..fa309a5 100644
--- a/lang/template.json
+++ b/lang/template.json
@@ -44,6 +44,7 @@
     "category:places_geo": "",
     "category:playgrounds": "",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "",
diff --git a/lang/uk.json b/lang/uk.json
index ae7ca29..96d8e03 100644
--- a/lang/uk.json
+++ b/lang/uk.json
@@ -44,6 +44,7 @@
     "category:places_geo": "Місцевість",
     "category:playgrounds": "Дитячий майданчик",
     "category:post": "",
+    "category:power_routes": "",
     "category:pt": "",
     "category:pt:routes": "",
     "category:pt:stops": "Зупинки та станції",
diff --git a/power_routes.json b/power_routes.json
new file mode 100644
index 0000000..dd3c6f4
--- /dev/null
+++ b/power_routes.json
@@ -0,0 +1,63 @@
+{
+    "type": "overpass",
+    "name": {
+        "en": "Power routes"
+    },
+    "query": {
+        "10": "relation[type=route][route=power]"
+    },
+    "members": true,
+    "feature": {
+        "pre": "{% set color = '#' ~ tags.operator|default('')|md5|slice(0, 6) %}",
+        "description": "{% if tags.operator %}{{ tags.operator }}{% endif %}",
+        "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% else %}{{ trans('unnamed') }}{% endif %}",
+        "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': color })|raw }}",
+        "markerSymbol": "",
+        "styles": ""
+    },
+    "memberFeature": {
+        "pre": [
+            "{% set refs = [] %}",
+            "{% set color = '#d41d8c' %}",
+            "{% if tags.ref %}",
+            "  {% for ref in tags.ref|split(';') %}",
+            "    {% set refs = refs|merge([ ref|trim ]) %}",
+            "  {% endfor %}",
+            "{% endif %}",
+            "",
+            "{% for master in masters %}",
+            "  {% if master.tags.operator %}",
+            "    {% set color = '#' ~ master.tags.operator|md5|slice(0, 6) %}",
+            "  {% endif %}",
+            "  {% if master.tags.ref %}",
+            "    {% set refs = refs|merge([ master.tags.ref ]) %}",
+            "  {% endif %}",
+            "{% endfor %}",
+            "",
+            "{% set refs = refs|unique|natsort({ insensitive: true }) %}"
+        ],
+        "body": [
+            "<h4>Routes</h4>",
+            "<ul>",
+            "{% for master in masters %}",
+            "  {% set _color = '#' ~ master.tags.operator|default('')|md5|slice(0, 6) %}",
+            "  <li data-object=\"{{ master.id }}\" style='list-style: none;'>",
+            "    <span class='markerParent'><div class='marker'>{{ markerLine({ width: 4, color: _color })|raw }}</div></span>",
+            "    <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>",
+            "    <span class='description'>{{ master.tags.operator }}</span>",
+            "  </li>",
+            "{% endfor %}",
+            "</ul>"
+        ],
+        "listExclude": "1",
+        "style": {
+            "color": "{{ color }}",
+            "width": 4,
+            "opacity": 1,
+            "text": "{{ refs|join(' · ') }}             ",
+            "textRepeat": "1",
+            "textOffset": "12",
+            "textFontWeight": "bold"
+        }
+    }
+}