diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 4543616..ce96f42 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -3,6 +3,7 @@ query: way[highway=cycleway]; way[cyclestreet=yes]; way[bicycle_road=yes]; + way["cycleway"]["cycleway"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; way["cycleway:both"]["cycleway:both"!~"(no|separate)"]; @@ -24,7 +25,30 @@ feature: {% set oneway = 0 %} {% endif %} - {% set leftCycle = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} + {% set leftCycle = '' %}{% set rightCycle = '' %} + + {% if tags.cycleway %} + {% if (tags.oneway in ['yes', 1] and map.driving_side == 'right') or (tags.oneway in [-1] and map.driving_side == 'left') %} + {{ tags.cycleway|debug }} + {% if tags.cycleway matches '/^opposite/' %} + {% set leftCycle = tags.cycleway %} + {% else %} + {% set rightCycle = tags.cycleway %} + {% endif %} + {% elseif (tags.oneway in ['yes', 1] and map.driving_side == 'left') or (tags.oneway in [-1] and map.driving_side == 'right') %} + {% if tags.cycleway matches '/^opposite/' %} + {% set rightCycle = tags.cycleway %} + {% else %} + {% set leftCycle = tags.cycleway %} + {% endif %} + {% else %} + {% set leftCycle = tags.cycleway %} + {% set rightCycle = tags.cycleway %} + {% endif %} + {% endif %} + + {% set leftCycle1 = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} + {% if leftCycle1 %}{% set leftCycle = leftCycle1 %}{% endif %} {% if leftCycle in ['no', 'separate'] %} {% set leftCycle = '' %} {% endif %} @@ -36,7 +60,8 @@ feature: {% set leftOneway = 0 %} {% endif %} - {% set rightCycle = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% set rightCycle1 = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% if rightCycle1 %}{% set rightCycle = rightCycle1 %}{% endif %} {% if rightCycle in ['no', 'separate'] %} {% set rightCycle = '' %} {% endif %} @@ -249,6 +274,15 @@ feature: body: | {% endif %} - {% if rightCycle %} + {% if attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
  • {{ keyTrans('cycleway:right') }}: {% if const.types[rightCycle].warning %}