From 32cac3c70061ddddf84d225adf4b6f10814e9cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Tue, 8 Aug 2017 22:01:37 +0200 Subject: [PATCH] Public transport categories --- index.json | 12 +++++++++++- pt_amenities.json | 16 +++++++++++++++- pt_routes.json | 14 ++++++++++++++ pt_stops.json | 9 +++++++++ 4 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 pt_routes.json diff --git a/index.json b/index.json index de5e311a..73b1e423 100644 --- a/index.json +++ b/index.json @@ -164,7 +164,17 @@ }, "id": "transport_pt", "type": "index", - "subCategories": [] + "subCategories": [ + { + "id": "pt_amenities" + }, + { + "id": "pt_stops" + }, + { + "id": "pt_routes" + } + ] }, { "name": { diff --git a/pt_amenities.json b/pt_amenities.json index c9e6833a..8eba1bae 100644 --- a/pt_amenities.json +++ b/pt_amenities.json @@ -1,4 +1,5 @@ { + "type": "overpass", "name": { "ast": "Infraestructures", "cs": "Občanská vybavenost", @@ -8,8 +9,21 @@ "it": "Infrastrutture", "ja": "生活環境", "nl": "Voorzieningen", - "pl": "", "ru": "Транспортные принадлежности", "uk": "Amenities" + }, + "query": { + "14": "(\nnode[amenity~\"^(taxi|ticket_counter)$\"];\nway[amenity~\"^(taxi|ticket_counter)$\"];\nrelation[amenity~\"^(taxi|ticket_counter)$\"];\nnode[railway~\"^(subway_entrance)$\"];\nway[railway~\"^(subway_entrance)$\"];\nrelation[railway~\"^(subway_entrance)$\"];\n)" + }, + "feature": { + "pre": "{% if tags.railway == 'subway_entrance' %}\n {% set key = 'railway' %}\n {% set value = tags.railway %}\n{% else %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% endif %}", + "description": "{{ tagTrans(key, value) }}", + "body": "{{ tagTrans(key, value) }}", + "markerSign": "{{ const[value] }}" + }, + "const": { + "taxi": "🚖", + "ticket_counter": "🎫", + "subway_entrance": "🚉" } } diff --git a/pt_routes.json b/pt_routes.json new file mode 100644 index 00000000..77fc687d --- /dev/null +++ b/pt_routes.json @@ -0,0 +1,14 @@ +{ + "type": "overpass", + "name": { + "en": "Routes", + "de": "Routen" + }, + "query": { + "13": "relation[type=route][route~\"^(bus|trolleybus|ferry|train|tram)$\"];" + }, + "feature": { + "description": "{{ tagTrans('route', tags.route) }}", + "title": "{% if tags.ref %}{{ tags.ref }} - {% endif %}\n\n{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(trans('unnamed')) }}" + } +} diff --git a/pt_stops.json b/pt_stops.json index 12bb605b..016604ea 100644 --- a/pt_stops.json +++ b/pt_stops.json @@ -1,4 +1,5 @@ { + "type": "overpass", "name": { "ast": "Paraes y estaciones", "cs": "Zastávky & Stanice", @@ -14,5 +15,13 @@ "pl": "Przystanki i Stacje", "ru": "Остановки и станции", "uk": "Зупинки та станції" + }, + "query": { + "14": "(\nnode[railway~\"^(station|halt|tram_stop|platform)$\"];\nway[railway~\"^(station|platform)$\"];\nnode[highway~\"^(bus_stop|platform)$\"];\nway[highway~\"^(platform)$\"];\nnode[public_transport~\"^(stop_position|platform)$\"];\nway[public_transport~\"^(platform)$\"];\nnode[amenity~\"^(ferry_terminal|bus_station)$\"];\n)" + }, + "feature": { + "pre": "{% if tags.amenity in [ 'ferry_terminal', 'bus_station' ] %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% elseif tags.railway == 'platform' or tags.highway == 'platform' or tags.public_transport == 'platform' %}\n {% set key = 'public_transport' %}\n {% set value = 'platform' %}\n{% else %}\n {% set key = 'public_transport' %}\n {% set value = 'stop_position' %}\n{% endif %}", + "description": "{{ tagTrans(key, value) }}", + "body": "{{ tagTrans(key, value) }}" } }