From b713c3bb0ecc7dee2aa89033dedd6822516be045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Fri, 20 Aug 2021 12:21:38 +0200 Subject: [PATCH] cycle_routes, hiking_routes: allow ';' in network tags --- cycle_routes.json | 20 +++++++++++++------- hiking_routes.json | 20 +++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/cycle_routes.json b/cycle_routes.json index 69ccde1..ecf5afe 100644 --- a/cycle_routes.json +++ b/cycle_routes.json @@ -9,18 +9,24 @@ "pt-br": "Ciclorrotas" }, "query": { - "6": "relation[type=route][route~\"(|.*;)bicycle(|;.*)\"][network~'^(icn)$']", - "9": "relation[type=route][route~\"(|.*;)bicycle(|;.*)\"][network~'^(icn|ncn)$']", - "12": "relation[type=route][route~\"(|.*;)bicycle(|;.*)\"][network~'^(icn|ncn|rcn)$']", - "15": "relation[type=route][route~\"(|.*;)bicycle(|;.*)\"]" + "6": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn)(|;.*)$']", + "9": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn|ncn)(|;.*)$']", + "12": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"][network~'^(|.*;)(icn|ncn|rcn)(|;.*)$']", + "15": "relation[type=route][route~\"^(|.*;)bicycle(|;.*)$\"]" }, "members": true, "feature": { + "pre": [ + "{% set network = tags.network %}", + "{% for n in tags.network|split(';') %}", + "{% if n|matches('cn$') %}{% set network = n %}{% endif %}", + "{% endfor %}" + ], "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}", - "description": "{{ tagTrans('network', tags.network) }}", + "description": "{{ tagTrans('network', network) }}", "markerSymbol": "", - "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[tags.network].color|default(const[''].color) })|raw }}", - "priority": "{{ const[tags.network].priority|default(4) }}", + "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[network].color|default(const[''].color) })|raw }}", + "priority": "{{ const[network].priority|default(4) }}", "styles": "", "style:hover": { "width": "0" diff --git a/hiking_routes.json b/hiking_routes.json index 2e1e25e..f0ce546 100644 --- a/hiking_routes.json +++ b/hiking_routes.json @@ -9,16 +9,22 @@ "pt-br": "Rotas de caminhada" }, "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(|;.*)\"]" + "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(|;.*)$\"]" }, "members": true, "feature": { - "priority": "{{ const[tags.network].priority|default(4) }}", - "description": "{% if tags.network %}{{ tagTrans('network', tags.network) }}{% endif %}", - "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[tags.network|default('')].color|default(const[''].color) })|raw }}", + "pre": [ + "{% set network = tags.network %}", + "{% for n in tags.network|split(';') %}", + "{% if n|matches('wn$') %}{% set network = n %}{% endif %}", + "{% endfor %}" + ], + "priority": "{{ const[network].priority|default(4) }}", + "description": "{% if network %}{{ tagTrans('network', network) }}{% endif %}", + "listMarkerSymbol": "{{ markerLine({ 'width': 4, 'color': const[network|default('')].color|default(const[''].color) })|raw }}", "title": "{% if tags.ref and tags.name %}{{ tags.ref }} - {{ tags.name }}{% elseif tags.ref %}{{ tags.ref }}{% elseif tags.name %}{{ tags.name }}{% endif %}", "styles": "", "markerSymbol": ""