From 169a50beeeb4c5d7a03a767604359aa2d285bf08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 21 Aug 2021 10:04:05 +0200 Subject: [PATCH] cycle_routes, hiking_routes: handle network tags with ';' on member ways --- cycle_routes.json | 16 ++++++++++++---- hiking_routes.json | 16 ++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/cycle_routes.json b/cycle_routes.json index ecf5afe1..68a8b966 100644 --- a/cycle_routes.json +++ b/cycle_routes.json @@ -46,10 +46,14 @@ "{% set selected = false %}", "", "{% for master in masters %}", - " {% set _p = const[master.tags.network].priority|default(4) %}", + " {% set masterNetwork = '' %}", + " {% for n in master.tags.network|split(';') %}", + " {% if n|matches('cn$') %}{% set masterNetwork = n %}{% endif %}", + " {% endfor %}", + " {% set _p = const[masterNetwork].priority|default(4) %}", " {% if _p < priority %}", " {% set priority = _p %}", - " {% set network = master.tags.network %}", + " {% set network = masterNetwork %}", " {% endif %}", " {% if master.tags.ref %}", " {% set refs = refs|merge([ master.tags.ref ]) %}", @@ -67,10 +71,14 @@ "

Routes

", "" diff --git a/hiking_routes.json b/hiking_routes.json index f0ce546d..a31378bb 100644 --- a/hiking_routes.json +++ b/hiking_routes.json @@ -36,10 +36,14 @@ "{% set refs = [] %}", "", "{% for master in masters %}", - " {% set _p = const[master.tags.network].priority|default(4) %}", + " {% set masterNetwork = '' %}", + " {% for n in master.tags.network|split(';') %}", + " {% if n|matches('wn$') %}{% set masterNetwork = n %}{% endif %}", + " {% endfor %}", + " {% set _p = const[masterNetwork].priority|default(4) %}", " {% if _p < priority %}", " {% set priority = _p %}", - " {% set network = master.tags.network %}", + " {% set network = masterNetwork %}", " {% endif %}", " {% if master.tags.ref %}", " {% set refs = refs|merge([ master.tags.ref ]) %}", @@ -50,10 +54,14 @@ "

Routes

", ""