From 01b0c78e98088ec65f64dc3cb52229096a610f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 7 Aug 2017 21:48:57 +0200 Subject: [PATCH] Walking categories --- hiking_routes.json | 32 +++++++++++++++++++++++++++ index.json | 9 +++++++- walk_amenities.json | 53 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 hiking_routes.json create mode 100644 walk_amenities.json diff --git a/hiking_routes.json b/hiking_routes.json new file mode 100644 index 000000000..5241b5bf5 --- /dev/null +++ b/hiking_routes.json @@ -0,0 +1,32 @@ +{ + "type": "overpass", + "name": { + "en": "Hiking routes", + "de": "Wanderrouten" + }, + "query": { + "10": "relation[type=route][route=hiking][network~\"^(iwn)$\"]", + "11": "relation[type=route][route=hiking][network~\"^(iwn|nwn)$\"]", + "12": "relation[type=route][route=hiking][network~\"^(iwn|nwn|rwn)$\"]", + "14": "relation[type=route][route=hiking]" + }, + "feature": { + "description": "{{ tagTrans('network', tags.network) }}", + "body": "{{ tagTrans('network', tags.network) }}", + "priority": "{% set network_data = const[tags.network] %}\n{% if network_data %}\n{{ network_data.priority }}\n{% endif %}" + }, + "const": { + "iwn": { + "priority": 1 + }, + "nwn": { + "priority": 2 + }, + "rwn": { + "priority": 3 + }, + "lwn": { + "priority": 4 + } + } +} diff --git a/index.json b/index.json index 6955af477..829f492d3 100644 --- a/index.json +++ b/index.json @@ -119,7 +119,14 @@ }, "id": "transport_walk", "type": "index", - "subCategories": [] + "subCategories": [ + { + "id": "walk_amenities" + }, + { + "id": "hiking_routes" + } + ] }, { "name": { diff --git a/walk_amenities.json b/walk_amenities.json new file mode 100644 index 000000000..69eeb1db5 --- /dev/null +++ b/walk_amenities.json @@ -0,0 +1,53 @@ +{ + "type": "overpass", + "name": { + "en": "Amenities", + "de": "Einrichtungen" + }, + "query": { + "13": "(\nnode[highway~\"^(elevator)$\"];\nnode[information];\nnode[tourism~\"^(viewpoint)$\"];\nnode[man_made~\"^(cairn)$\"];\nnode[amenity~\"^(shelter)$\"];\nway[amenity~\"^(shelter)$\"];\nrelation[amenity~\"^(shelter)$\"];\n)", + "17": "(\nnode[highway~\"^(crossing|elevator)$\"];\nnode[information];\nnode[tourism~\"^(viewpoint)$\"];\nnode[man_made~\"^(cairn)$\"];\nnode[amenity~\"^(shelter)$\"];\nway[amenity~\"^(shelter)$\"];\nrelation[amenity~\"^(shelter)$\"];\n)" + }, + "feature": { + "pre": "{% if tags.information %}\n {% set key = 'information' %}\n {% set value = tags.information %}\n{% elseif tags.amenity in [ 'bench', 'shelter' ] %}\n {% set key = 'amenity' %}\n {% set value = tags.amenity %}\n{% elseif tags.man_made in [ 'cairn' ] %}\n {% set key = 'man_made' %}\n {% set value = tags.man_made %}\n{% elseif tags.tourism in [ 'viewpoint'] %}\n {% set key = 'tourism' %}\n {% set value = tags.tourism %}\n{% else %}\n {% set key = 'highway' %}\n {% set value = tags.highway %}\n{% endif %}\n\n{% set type_data = const[value] %}", + "description": "{{ tagTrans(key, value) }}", + "body": "{{ tagTrans(key, value) }}", + "title": "{{ localizedTag(tags, 'name') |default(localizedTag(tags, 'operator')) | default(localizedTag(tags, 'ref')) | default(tagTrans(key, value)) }}", + "markerSign": "{{ type_data.sign|raw }}", + "priority": "{{ type_data.priority }}" + }, + "const": { + "crossing": { + "priority": 10, + "sign": "" + }, + "elevator": { + "priority": 2, + "sign": "" + }, + "guidepost": { + "priority": 2, + "sign": "" + }, + "map": { + "priority": 2, + "sign": "" + }, + "board": { + "priority": 2, + "sign": "" + }, + "office": { + "priority": 1, + "sign": "" + }, + "cairn": { + "priority": 2, + "sign": "" + }, + "shelter": { + "priority": 1, + "sign": "⌃" + } + } +}