From d3075253f42ae5d003e3dacadfcb6122410ea729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Jul 2024 07:19:35 +0200 Subject: [PATCH 01/41] cycleway_types: new category --- index.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.json b/index.json index 3d6fdfd..2c90c69 100644 --- a/index.json +++ b/index.json @@ -187,6 +187,9 @@ }, { "id": "cycle_routes" + }, + { + "id": "cycleway_types" } ] }, From fe8837e52e8bdd05bee86adccc3950db4506fa8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 15 Jul 2024 07:55:27 +0200 Subject: [PATCH 02/41] cycleway_types: show cycleways with segregation --- cycleway_types.yaml | 83 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 cycleway_types.yaml diff --git a/cycleway_types.yaml b/cycleway_types.yaml new file mode 100644 index 0000000..21c6ac2 --- /dev/null +++ b/cycleway_types.yaml @@ -0,0 +1,83 @@ +query: + ( + way[highway=cycleway]; + ) +feature: + styles: | + {% if tags.segregated %} + footway, + {% endif %} + default + style: + width: | + {% if tags.segregated %} + {{ tags.segregated == 'yes' ? 2 : 4 %} + {% else %} + 4 + {% endif %} + + dashArray: | + {% if tags.segregated == 'no' %} + 5,5 + {% endif %} + + lineCap: | + {% if tags.segregated == 'no' %} + butt + {% else %} + round + {% endif %} + + color: | + {{ const.types.cycleway.color }} + + offset: | + {% if tags.segregated == 'yes' %} + 1.5 + {% endif %} + + style:footway: + color: | + {{ const.types.footway.color }} + + width: | + {% if tags.segregated %} + {{ tags.segregated == 'yes' ? 2 : 4 %} + {% else %} + 4 + {% endif %} + + dashArray: | + {% if tags.segregated == 'no' %} + 5,5 + {% endif %} + + dashOffset: 5 + + lineCap: | + {% if tags.segregated == 'no' %} + butt + {% else %} + round + {% endif %} + + offset: | + {% if tags.segregated == 'yes' %} + -1.5 + {% endif %} + + description: | + {% if tags.segregated %} + {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }} + {% elseif tags.highway %} + {{ tagTrans('highway', tags.highway) }} + {% endif %} + + markerSymbol: '' + +const: + types: + cycleway: + color: '#007f00' + footway: + color: '#ff7f00' From 321998e50f72e736258898ea31363f24e4bcec21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Mon, 15 Jul 2024 08:11:53 +0200 Subject: [PATCH 03/41] cycleway_types: include bicycle_road=* and cyclestreet=* --- cycleway_types.yaml | 47 +++++++++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 21c6ac2..12e8ce7 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -1,8 +1,19 @@ query: ( way[highway=cycleway]; + way[cyclestreet=yes]; + way[bicycle_road=yes]; ) feature: + pre: | + {% set type = tags.highway %} + + {% if tags.cyclestreet == 'yes' %} + {% set type = 'cyclestreet' %} + {% elseif tags.bicycle_road in ['yes', 'designated'] %} + {% set type = 'bicycle_road' %} + {% endif %} + styles: | {% if tags.segregated %} footway, @@ -10,10 +21,10 @@ feature: default style: width: | - {% if tags.segregated %} - {{ tags.segregated == 'yes' ? 2 : 4 %} + {% if tags.segregated == 'yes' %} + {{ const.types[type].width / 2 }} {% else %} - 4 + {{ const.types[type].width }} {% endif %} dashArray: | @@ -29,11 +40,11 @@ feature: {% endif %} color: | - {{ const.types.cycleway.color }} + {{ const.types[type].color }} offset: | {% if tags.segregated == 'yes' %} - 1.5 + {{ const.types[type].width / 2 - 1 }} {% endif %} style:footway: @@ -41,10 +52,10 @@ feature: {{ const.types.footway.color }} width: | - {% if tags.segregated %} - {{ tags.segregated == 'yes' ? 2 : 4 %} + {% if tags.segregated == 'yes' %} + {{ const.types.footway.width / 2 }} {% else %} - 4 + {{ const.types.footway.width }} {% endif %} dashArray: | @@ -63,11 +74,15 @@ feature: offset: | {% if tags.segregated == 'yes' %} - -1.5 + {{ (const.types.footway.width / 2 - 1) * -1 }} {% endif %} description: | - {% if tags.segregated %} + {% if tags.cyclestreet == 'yes' %} + {{ keyTrans('cyclestreet') }} + {% elseif tags.bicycle_road in ['yes', 'designated'] %} + {{ keyTrans('bicycle_road') }} + {% elseif tags.segregated %} {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }} {% elseif tags.highway %} {{ tagTrans('highway', tags.highway) }} @@ -78,6 +93,14 @@ feature: const: types: cycleway: - color: '#007f00' + color: '#009f00' + width: 4 footway: - color: '#ff7f00' + color: '#ff9f00' + width: 4 + cyclestreet: + color: '#006f3f' + width: 8 + bicycle_road: + color: '#006f4f' + width: 8 From e8c0ba1f9f5e5b219f2ad62744334b3d67c1d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 17 Jul 2024 22:53:51 +0200 Subject: [PATCH 04/41] cycleway_types: oneway --- cycleway_types.yaml | 70 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 5 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 12e8ce7..af59e6c 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -14,6 +14,13 @@ feature: {% set type = 'bicycle_road' %} {% endif %} + {% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %} + {% if oneway == 'yes' %} + {% set oneway = 1 %} + {% elseif oneway == 'no' %} + {% set oneway = 0 %} + {% endif %} + styles: | {% if tags.segregated %} footway, @@ -28,12 +35,25 @@ feature: {% endif %} dashArray: | - {% if tags.segregated == 'no' %} + {% if oneway and tags.segregated == 'no' %} + 5,5,5,20 + {% elseif oneway %} + 25,10 + {% elseif tags.segregated == 'no' %} 5,5 {% endif %} + dashOffset: | + {% if oneway and tags.segregated == 'no' %} + 5 + {% elseif oneway %} + 10 + {% elseif tags.segregated == 'no' %} + 0 + {% endif %} + lineCap: | - {% if tags.segregated == 'no' %} + {% if tags.segregated == 'no' or oneway %} butt {% else %} round @@ -47,6 +67,34 @@ feature: {{ const.types[type].width / 2 - 1 }} {% endif %} + pattern: | + {% if oneway -%} + arrowHead + {%- endif %} + + pattern-repeat: | + 35 + + pattern-offset: | + {{ oneway == -1 ? 17 : 22 }} + + noClip: | + {{ oneway != 0 }} + + pattern-polygon: true + + pattern-pixelSize: 9 + + pattern-angleCorrection: | + {{ oneway == -1 ? 180 : 0 }} + + pattern-path-color: | + {{ const.types[type].color }} + + pattern-path-width: 0 + + pattern-path-fillOpacity: 1 + style:footway: color: | {{ const.types.footway.color }} @@ -59,14 +107,26 @@ feature: {% endif %} dashArray: | - {% if tags.segregated == 'no' %} + {% if oneway and tags.segregated == 'no' %} + 5,5,5,5,5,10 + {% elseif oneway %} + 25,10 + {% elseif tags.segregated == 'no' %} 5,5 {% endif %} - dashOffset: 5 + dashOffset: | + {% if oneway %} + 10 + {% elseif tags.segregated == 'no' %} + 5 + {% endif %} + + noClip: | + {{ oneway != 0 }} lineCap: | - {% if tags.segregated == 'no' %} + {% if tags.segregated == 'no' or oneway %} butt {% else %} round From 64c752caa72e06dee206b81baba87447c75da97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Jul 2024 07:18:36 +0200 Subject: [PATCH 05/41] cycleway_types: show cycleway:left --- cycleway_types.yaml | 96 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index af59e6c..eacd97b 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -3,6 +3,9 @@ query: way[highway=cycleway]; way[cyclestreet=yes]; way[bicycle_road=yes]; + way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; + way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; + way["cycleway:both"]["cycleway:both"!~"(no|separate)"]; ) feature: pre: | @@ -21,11 +24,26 @@ feature: {% set oneway = 0 %} {% endif %} + {% set leftCycle = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} + {% if leftCycle in ['no', 'separate'] %} + {% set leftCycle = '' %} + {% endif %} + + {% set leftOneway = attribute(tags, 'cycleway:left:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} + {% if not leftOneway or leftOneway in ['yes'] %} + {% set leftOneway = map.driving_side == 'left' ? 1 : -1 %} + {% elseif leftOneway in ['no'] %} + {% set leftOneway = 0 %} + {% endif %} + styles: | {% if tags.segregated %} footway, {% endif %} default + {% if leftCycle %} + ,left + {% endif %} style: width: | {% if tags.segregated == 'yes' %} @@ -137,6 +155,39 @@ feature: {{ (const.types.footway.width / 2 - 1) * -1 }} {% endif %} + style:left: + offset: -5 + + color: | + {{ const.types[leftCycle].color|default('#ff0000') }} + + width: 3 + + lineCap: | + {{ leftOneway ? 'butt' : 'round' }} + dashArray: | + {{ leftOneway ? '27,8' : '' }} + dashOffset: | + {{ leftOneway == -1 ? 28 : 0 }} + noClip: true +# {{ leftOneway }} + pattern: | + {% if leftOneway %}arrowHead{% endif %} + pattern-offset: | + {{ leftOneway == -1 ? 4 : 30.5 }} + pattern-lineOffset: -5 + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ leftOneway == -1 ? 180 : 0 }} + pattern-path-width: 0 + + pattern-path-color: | + {{ const.types[leftCycle].color|default('#ff0000') }} + + pattern-path-fillOpacity: 1 + description: | {% if tags.cyclestreet == 'yes' %} {{ keyTrans('cyclestreet') }} @@ -148,6 +199,39 @@ feature: {{ tagTrans('highway', tags.highway) }} {% endif %} + body: | +
    + {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %} +
  • + {{ keyTrans('cycleway:width') }}: + {% if not attribute(tags, 'cycleway:width') %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:width') }} + {% else %} + {{ attribute(tags, 'cycleway:width') }}m + {% endif %} +
  • + {% endif %} + + {% if leftCycle %} +
  • {{ keyTrans('cycleway:left') }}:
      +
    • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}
    • +
    • + {{ keyTrans('cycleway:width') }}: + {% if not leftWidth %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }} + {% else %} + {{ leftWidth }}m + {% endif %} +
    • +
  • + {% endif %} + +
+ markerSymbol: '' const: @@ -164,3 +248,15 @@ const: bicycle_road: color: '#006f4f' width: 8 + lane: + color: '#00df3f' + shared_lane: + color: '#003faf' + share_busway: + color: '#ff7f00' + opposite_lane: + color: '#ff0000' + warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' + track: + color: '#ff0000' + warning: 'Deprecated tag! Consider tagging as separate way with highway=cycleway.' From c09b60d86f46622fe695d9afb165271932f452d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Jul 2024 07:34:10 +0200 Subject: [PATCH 06/41] cycleway_types: render cycleway:right --- cycleway_types.yaml | 66 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index eacd97b..e9eb8d5 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -36,6 +36,18 @@ feature: {% set leftOneway = 0 %} {% endif %} + {% set rightCycle = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% if rightCycle in ['no', 'separate'] %} + {% set rightCycle = '' %} + {% endif %} + + {% set rightOneway = attribute(tags, 'cycleway:right:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} + {% if not rightOneway or rightOneway in ['yes'] %} + {% set rightOneway = map.driving_side == 'left' ? -1 : 1 %} + {% elseif rightOneway in ['no'] %} + {% set rightOneway = 0 %} + {% endif %} + styles: | {% if tags.segregated %} footway, @@ -44,6 +56,9 @@ feature: {% if leftCycle %} ,left {% endif %} + {% if rightCycle %} + ,right + {% endif %} style: width: | {% if tags.segregated == 'yes' %} @@ -188,6 +203,39 @@ feature: pattern-path-fillOpacity: 1 + style:right: + offset: 5 + + color: | + {{ const.types[rightCycle].color|default('#ff0000') }} + + width: 3 + + lineCap: | + {{ rightOneway ? 'butt' : 'round' }} + dashArray: | + {{ rightOneway ? '27,8' : '' }} + dashOffset: | + {{ rightOneway == -1 ? 28 : 0 }} + noClip: true +# {{ rightOneway }} + pattern: | + {% if rightOneway %}arrowHead{% endif %} + pattern-offset: | + {{ rightOneway == -1 ? 4 : 30.5 }} + pattern-lineOffset: 5 + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ rightOneway == -1 ? 180 : 0 }} + pattern-path-width: 0 + + pattern-path-color: | + {{ const.types[rightCycle].color|default('#ff0000') }} + + pattern-path-fillOpacity: 1 + description: | {% if tags.cyclestreet == 'yes' %} {{ keyTrans('cyclestreet') }} @@ -230,6 +278,21 @@ feature: {% endif %} + {% if rightCycle %} +
  • {{ keyTrans('cycleway:right') }}:
      +
    • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}
    • +
    • + {{ keyTrans('cycleway:width') }}: + {% if not rightWidth %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }} + {% else %} + {{ rightWidth }}m + {% endif %} +
    • +
  • + {% endif %} markerSymbol: '' @@ -254,6 +317,9 @@ const: color: '#003faf' share_busway: color: '#ff7f00' + opposite: + color: '#ff0000' + warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' opposite_lane: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' From 41ad6c0940e17291ed1519ab0e0c05d10243f3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 13 Jul 2024 07:31:32 +0200 Subject: [PATCH 07/41] cycleway_width: initial commit --- cycleway_width.yaml | 25 +++++++++++++++++++++++++ index.json | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 cycleway_width.yaml diff --git a/cycleway_width.yaml b/cycleway_width.yaml new file mode 100644 index 0000000..46eede7 --- /dev/null +++ b/cycleway_width.yaml @@ -0,0 +1,25 @@ +query: | + ( + way[highway=cycleway]; + way["cycleway:width"]; + ) +feature: + style: + width: 4 + color: | + {% set optWidth = tags.oneway in ['yes', 1, -1] ? 3 : 5 %} + {% if attribute(tags, 'cycleway:width') %} + {% set width = attribute(tags, 'cycleway:width') %} + {{ colorInterpolate(['#ff0000', '#0000ff'], width / optWidth) }} + {% else %}black + {% endif %} + markerSymbol: false + listMarkerSymbol: line + description: | + {{ tagTrans('highway', tags.highway) }} + details: | + {{ attribute(tags, 'cycleway:width') }} + body: | +
      +
    • {{ keyTrans('cycleway:width') }}: {{ attribute(tags, 'cycleway:width') }}
    • +
    \ No newline at end of file diff --git a/index.json b/index.json index 2c90c69..7c09b74 100644 --- a/index.json +++ b/index.json @@ -190,6 +190,9 @@ }, { "id": "cycleway_types" + }, + { + "id": "cycleway_width" } ] }, From 4cb21285a4a4274247e2f6d154323dd4733ff4cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 13 Jul 2024 07:46:09 +0200 Subject: [PATCH 08/41] cycleway_width: include unit, parse foot --- cycleway_width.yaml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 46eede7..1283330 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -7,10 +7,15 @@ feature: style: width: 4 color: | - {% set optWidth = tags.oneway in ['yes', 1, -1] ? 3 : 5 %} - {% if attribute(tags, 'cycleway:width') %} {% set width = attribute(tags, 'cycleway:width') %} - {{ colorInterpolate(['#ff0000', '#0000ff'], width / optWidth) }} + {% if width matches "/'$/" %} + {% set width = (width|slice(0, -1)) * 0.3048 %} + {% endif %} + + {% set optWidth = tags.oneway in ['yes', 1, -1] ? 3 : 5 %} + + {% if width %} + {{ colorInterpolate(['#ff0000', '#7f7f7ff'], width / optWidth) }} {% else %}black {% endif %} markerSymbol: false @@ -18,8 +23,20 @@ feature: description: | {{ tagTrans('highway', tags.highway) }} details: | - {{ attribute(tags, 'cycleway:width') }} + {% if not attribute(tags, 'cycleway:width') %} + {% elseif attribute(tags, 'cycleway:width') matches "/'$/" %} + {{ attribute(tags, 'cycleway:width') }} + {% else %} + {{ attribute(tags, 'cycleway:width') }}m + {% endif %} body: |
      -
    • {{ keyTrans('cycleway:width') }}: {{ attribute(tags, 'cycleway:width') }}
    • -
    \ No newline at end of file +
  • + {{ keyTrans('cycleway:width') }}: + {% if not attribute(tags, 'cycleway:width') %} + {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:width') }} + {% else %} + {{ attribute(tags, 'cycleway:width') }}m + {% endif %} + From 73a491c6dd3d7fb290c97517e5318676abb0440b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 13 Jul 2024 08:09:53 +0200 Subject: [PATCH 09/41] cycleway_width: configure values via const, map info --- cycleway_width.yaml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 1283330..b2107ba 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -12,10 +12,11 @@ feature: {% set width = (width|slice(0, -1)) * 0.3048 %} {% endif %} - {% set optWidth = tags.oneway in ['yes', 1, -1] ? 3 : 5 %} + {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %} + {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %} {% if width %} - {{ colorInterpolate(['#ff0000', '#7f7f7ff'], width / optWidth) }} + {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }} {% else %}black {% endif %} markerSymbol: false @@ -40,3 +41,32 @@ feature: {{ attribute(tags, 'cycleway:width') }}m {% endif %} +info: | + + + + + + + {% for v in range(0, 1, 0.25) %} + + + + + + {% endfor %} +
    Symbol{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'yes') }}{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'no') }}
    + {{ markerLine({ width: 4, color: colorInterpolate(const.colorScheme, v) }) }} + + {% if v == 0 %}<={% elseif v == 1 %}>={% endif %} + {{ (const.minWidthOneway + (v * (const.optWidthOneway - const.minWidthOneway)))|number_format(2) }}m + + {% if v == 0 %}<={% elseif v == 1 %}>={% endif %} + {{ (const.minWidthBoth + (v * (const.optWidthBoth - const.minWidthBoth)))|number_format(2) }}m +
    +const: + minWidthBoth: 1.5 + optWidthBoth: 5 + minWidthOneway: 0.75 + optWidthOneway: 3 + colorScheme: ['#ff0000', '#7f7fff', '#0000ff'] From b77d5c5efd0ec674a008ef0772378b8dd2c607d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 13 Jul 2024 08:34:37 +0200 Subject: [PATCH 10/41] cycleway_width: arrows for oneway cycleways --- cycleway_width.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index b2107ba..717ae3e 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -19,6 +19,30 @@ feature: {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }} {% else %}black {% endif %} + lineCap: | + {{ tags.oneway in ['yes', 1, -1] ? 'butt' : 'round' }} + dashArray: | + {{ tags.oneway in ['yes', 1, -1] ? '27,8' : '' }} + dashOffset: | + {{ tags.oneway in [-1] ? 28 : 0 }} + noClip: | + {{ tags.oneway in ['yes', 1, -1] }} + pattern: | + {% if tags.oneway in ['yes', 1, -1] %}arrowHead{% endif %} + pattern-offset: | + {{ tags.oneway in [-1] ? 4 : 30.5 }} + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ tags.oneway in [-1] ? 180 : 0 }} + pattern-path-width: 0 + pattern-path-color: | + {% if width %} + {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }} + {% else %}black + {% endif %} + pattern-path-fillOpacity: 1 markerSymbol: false listMarkerSymbol: line description: | From 465d3fb52f29ada945f49e81d724c043534f349e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 13 Jul 2024 12:54:10 +0200 Subject: [PATCH 11/41] cycleway_width: improvements --- cycleway_width.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 717ae3e..89699c2 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -5,13 +5,13 @@ query: | ) feature: style: - width: 4 - color: | + pre: | {% set width = attribute(tags, 'cycleway:width') %} {% if width matches "/'$/" %} {% set width = (width|slice(0, -1)) * 0.3048 %} {% endif %} - + width: 4 + color: | {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %} {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %} @@ -59,6 +59,7 @@ feature:
  • {{ keyTrans('cycleway:width') }}: {% if not attribute(tags, 'cycleway:width') %} + {{ trans('unknown') }} {% elseif attribute(tags, 'cycleway:width') matches "/(m|')$/" %} {{ attribute(tags, 'cycleway:width') }} {% else %} From 2b100650741c9aa8e49f5e983a1607cb485dbd25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 14 Jul 2024 07:59:59 +0200 Subject: [PATCH 12/41] cycleway_width: Show left/right cycleway --- cycleway_width.yaml | 155 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 149 insertions(+), 6 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 89699c2..1a66141 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -2,15 +2,54 @@ query: | ( way[highway=cycleway]; way["cycleway:width"]; + way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; + way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; + way["cycleway:both"]["cycleway:both"!~"(no|separate)"]; ) feature: + pre: | + {% set driving_side = 'right' %} + + {% set width = attribute(tags, 'cycleway:width') %} + {% if width matches "/'$/" %} + {% set width = (width|slice(0, -1)) * 0.3048 %} + {% endif %} + + {% set leftCycle = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} + {% if leftCycle in ['no', 'separate'] %} + {% set leftCycle = '' %} + {% endif %} + {% set leftOneway = attribute(tags, 'cycleway:left:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} + {% if not leftOneway or leftOneway in ['yes'] %} + {% set leftOneway = driving_side ? -1 : 1 %} + {% elseif leftOneway in ['no'] %} + {% set leftOneway = 0 %} + {% endif %} + {% set leftWidth = attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) %} + {% if leftWidth matches "/'$/" %} + {% set leftWidth = (leftWidth|slice(0, -1)) * 0.3048 %} + {% endif %} + + {% set rightCycle = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% if rightCycle in ['no', 'separate'] %} + {% set rightCycle = '' %} + {% endif %} + {% set rightOneway = attribute(tags, 'cycleway:right:oneway')|default(attribute(tags, 'cycleway:both:oneway')) %} + {% if not rightOneway or rightOneway in ['yes'] %} + {% set rightOneway = driving_side ? 1 : -1 %} + {% elseif rightOneway in ['no'] %} + {% set rightOneway = 0 %} + {% endif %} + {% set rightWidth = attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) %} + {% if rightWidth matches "/'$/" %} + {% set rightWidth = (rightWidth|slice(0, -1)) * 0.3048 %} + {% endif %} + + styles: default{% if leftCycle %},left{% endif %}{% if rightCycle %},right{% endif %} style: - pre: | - {% set width = attribute(tags, 'cycleway:width') %} - {% if width matches "/'$/" %} - {% set width = (width|slice(0, -1)) * 0.3048 %} - {% endif %} width: 4 + opacity: | + {{ tags.highway == 'cycleway' or attribute(tags, 'cycleway:width') ? 1 : 0 }} color: | {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %} {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %} @@ -28,7 +67,9 @@ feature: noClip: | {{ tags.oneway in ['yes', 1, -1] }} pattern: | + {% if tags.highway == 'cycleway' or attribute(tags, 'cycleway:width') %} {% if tags.oneway in ['yes', 1, -1] %}arrowHead{% endif %} + {% endif %} pattern-offset: | {{ tags.oneway in [-1] ? 4 : 30.5 }} pattern-repeat: 35 @@ -43,6 +84,80 @@ feature: {% else %}black {% endif %} pattern-path-fillOpacity: 1 + style:left: + offset: -5 + width: | + {{ leftCycle in ['no', 'separate'] ? 0 : 3 }} + color: | + {% set minWidth = const.minWidthOneway %} + {% set optWidth = const.optWidthOneway %} + + {% if leftWidth %} + {{ colorInterpolate(const.colorScheme, (leftWidth - minWidth) / (optWidth - minWidth)) }} + {% else %}black + {% endif %} + lineCap: | + {{ leftOneway ? 'butt' : 'round' }} + dashArray: | + {{ leftOneway ? '27,8' : '' }} + dashOffset: | + {{ leftOneway in [-1] ? 28 : 0 }} + noClip: | + {{ leftOneway }} + pattern: | + {% if leftOneway %}arrowHead{% endif %} + pattern-offset: | + {{ leftOneway == -1 ? 4 : 30.5 }} + pattern-lineOffset: -5 + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ leftOneway == -1 ? 180 : 0 }} + pattern-path-width: 0 + pattern-path-color: | + {% if leftWidth %} + {{ colorInterpolate(const.colorScheme, (leftWidth - minWidth) / (optWidth - minWidth)) }} + {% else %}black + {% endif %} + pattern-path-fillOpacity: 1 + style:right: + offset: 5 + width: | + {{ rightCycle in ['no', 'separate'] ? 0 : 3 }} + color: | + {% set minWidth = const.minWidthOneway %} + {% set optWidth = const.optWidthOneway %} + + {% if rightWidth %} + {{ colorInterpolate(const.colorScheme, (rightWidth - minWidth) / (optWidth - minWidth)) }} + {% else %}black + {% endif %} + lineCap: | + {{ rightOneway ? 'butt' : 'round' }} + dashArray: | + {{ rightOneway ? '27,8' : '' }} + dashOffset: | + {{ rightOneway in [-1] ? 28 : 0 }} + noClip: | + {{ rightOneway }} + pattern: | + {% if rightOneway %}arrowHead{% endif %} + pattern-offset: | + {{ rightOneway == -1 ? 4 : 30.5 }} + pattern-lineOffset: 5 + pattern-repeat: 35 + pattern-polygon: true + pattern-pixelSize: 9 + pattern-angleCorrection: | + {{ rightOneway == -1 ? 180 : 0 }} + pattern-path-width: 0 + pattern-path-color: | + {% if rightWidth %} + {{ colorInterpolate(const.colorScheme, (rightWidth - minWidth) / (optWidth - minWidth)) }} + {% else %}black + {% endif %} + pattern-path-fillOpacity: 1 markerSymbol: false listMarkerSymbol: line description: | @@ -56,6 +171,7 @@ feature: {% endif %} body: |
      + {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
    • {{ keyTrans('cycleway:width') }}: {% if not attribute(tags, 'cycleway:width') %} @@ -65,6 +181,33 @@ feature: {% else %} {{ attribute(tags, 'cycleway:width') }}m {% endif %} +
    • + {% endif %} + + {% if leftCycle %} +
    • + {{ keyTrans('cycleway:left:width') }}: + {% if not leftWidth %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }} + {% else %} + {{ leftWidth }}m + {% endif %} +
    • + {% endif %} + {% if rightCycle %} +
    • + {{ keyTrans('cycleway:right:width') }}: + {% if not rightWidth %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) }} + {% else %} + {{ rightWidth }}m + {% endif %} +
    • + {% endif %}
    info: | @@ -94,4 +237,4 @@ const: optWidthBoth: 5 minWidthOneway: 0.75 optWidthOneway: 3 - colorScheme: ['#ff0000', '#7f7fff', '#0000ff'] + colorScheme: ['#ff0000', '#ff00ff', '#0000ff'] From f875570c4732942b28ac8ed785ee97164d50ca13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 14 Jul 2024 08:17:27 +0200 Subject: [PATCH 13/41] cycleway_width: improve popup body --- cycleway_width.yaml | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 1a66141..bf05bea 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -185,20 +185,26 @@ feature: {% endif %} {% if leftCycle %} -
  • - {{ keyTrans('cycleway:left:width') }}: - {% if not leftWidth %} - {{ trans('unknown') }} - {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} - {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }} - {% else %} - {{ leftWidth }}m - {% endif %} -
  • +
  • {{ keyTrans('cycleway:left') }}:
      +
    • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}
    • +
    • + {{ keyTrans('cycleway:width') }}: + {% if not leftWidth %} + {{ trans('unknown') }} + {% elseif attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} + {{ attribute(tags, 'cycleway:left:width')|default(attribute(tags, 'cycleway:both:width')) }} + {% else %} + {{ leftWidth }}m + {% endif %} +
    • +
  • {% endif %} + {% if rightCycle %} -
  • - {{ keyTrans('cycleway:right:width') }}: +
  • {{ keyTrans('cycleway:right') }}:
      +
    • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}
    • +
    • + {{ keyTrans('cycleway:width') }}: {% if not rightWidth %} {{ trans('unknown') }} {% elseif attribute(tags, 'cycleway:right:width')|default(attribute(tags, 'cycleway:both:width')) matches "/(m|')$/" %} @@ -206,7 +212,8 @@ feature: {% else %} {{ rightWidth }}m {% endif %} -
    • + +
  • {% endif %} info: | From b6530e334e967c1f5fdbd31b92194f3ee4cdffcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 14 Jul 2024 08:37:23 +0200 Subject: [PATCH 14/41] cycleway_width: set unknownColor in const, add to info --- cycleway_width.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index bf05bea..956c58a 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -56,7 +56,7 @@ feature: {% if width %} {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} lineCap: | {{ tags.oneway in ['yes', 1, -1] ? 'butt' : 'round' }} @@ -81,7 +81,7 @@ feature: pattern-path-color: | {% if width %} {{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} pattern-path-fillOpacity: 1 style:left: @@ -94,7 +94,7 @@ feature: {% if leftWidth %} {{ colorInterpolate(const.colorScheme, (leftWidth - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} lineCap: | {{ leftOneway ? 'butt' : 'round' }} @@ -118,7 +118,7 @@ feature: pattern-path-color: | {% if leftWidth %} {{ colorInterpolate(const.colorScheme, (leftWidth - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} pattern-path-fillOpacity: 1 style:right: @@ -131,7 +131,7 @@ feature: {% if rightWidth %} {{ colorInterpolate(const.colorScheme, (rightWidth - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} lineCap: | {{ rightOneway ? 'butt' : 'round' }} @@ -155,7 +155,7 @@ feature: pattern-path-color: | {% if rightWidth %} {{ colorInterpolate(const.colorScheme, (rightWidth - minWidth) / (optWidth - minWidth)) }} - {% else %}black + {% else %}{{ const.unknownColor }} {% endif %} pattern-path-fillOpacity: 1 markerSymbol: false @@ -223,6 +223,17 @@ info: |
    + + + + + {% for v in range(0, 1, 0.25) %} {% endif %} @@ -458,7 +463,7 @@ info: | {{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }} {% endfor %} @@ -483,9 +488,11 @@ const: cyclestreet: color: '#006f3f' width: 8 + label: cyclestreet bicycle_road: color: '#006f4f' width: 8 + label: bicycle_road lane: color: '#00df3f' track: From 7fadb51676fa9efa5798db9b0f102cae63517676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 13:10:10 +0100 Subject: [PATCH 39/41] cycleway_types: show highway=living_street --- cycleway_types.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index ecb93f0..55a63bd 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -4,6 +4,7 @@ query: way[cyclestreet=yes]; way[bicycle_road=yes]; way[highway=path][bicycle][bicycle!=no]; + way[highway=living_street]; way["cycleway"]["cycleway"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; @@ -21,6 +22,8 @@ feature: {% set type = 'cyclestreet' %} {% elseif tags.bicycle_road in ['yes', 'designated'] %} {% set type = 'bicycle_road' %} + {% elseif tags.highway and const.types['highway=' ~ tags.highway] %} + {% set type = 'highway=' ~ tags.highway %} {% endif %} {% set mainOneway = tags.oneway %} @@ -341,6 +344,8 @@ feature: {{ keyTrans('cyclestreet') }} {% elseif tags.bicycle_road in ['yes', 'designated'] %} {{ keyTrans('bicycle_road') }} + {% elseif tags.highway and const.types['highway=' ~ tags.highway] %} + {{ tagTrans('highway', tags.highway) }} {% elseif tags.segregated %} {{ tagTrans('highway', 'cycleway segregated=' ~ tags.segregated) }} {% elseif tags.highway %} @@ -479,12 +484,6 @@ info: |
    {{ keyTrans('oneway') }}={{ tagTrans('oneway', 'yes') }} {{ keyTrans('oneway') }}={{ tagTrans('oneway', 'no') }}
    + {{ markerLine({ width: 4, color: const.unknownColor }) }} + + {{ trans('unknown') }} + + {{ trans('unknown') }} +
    @@ -245,3 +256,4 @@ const: minWidthOneway: 0.75 optWidthOneway: 3 colorScheme: ['#ff0000', '#ff00ff', '#0000ff'] + unknownColor: black From e14b2de218ec33d674722e400e72e4cb8d9d8f06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 24 Jul 2024 07:41:33 +0200 Subject: [PATCH 15/41] cycleway_types: info --- cycleway_types.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index e9eb8d5..ea9cc97 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -297,6 +297,23 @@ feature: markerSymbol: '' +info: | + + + + + + {% for k, v in const.types %} + + + + + {% endfor %} +
    Symbol
    + {{ markerLine({ width: 4, color: v.color }) }} + + {{ k }} +
    const: types: cycleway: From 23f6178d1dbbbda30f27c6c173f7c520c50f0f04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 25 Jul 2024 07:27:43 +0200 Subject: [PATCH 16/41] cycleway_types: print warnings for deprecated tags --- cycleway_types.yaml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index ea9cc97..7ff5f3d 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -263,7 +263,15 @@ feature: {% endif %} {% if leftCycle %} -
  • {{ keyTrans('cycleway:left') }}:
      +
    • {{ keyTrans('cycleway:left') }}: + + {% if const.types[leftCycle].warning %} +
      {{ const.types[leftCycle].warning }}
      + {% elseif not const.types[leftCycle] %} +
      Invalid tag cycleway:left={{ attribute(tags, 'cycleway:left') }}.
      + {% endif %} + +
      • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}
      • {{ keyTrans('cycleway:width') }}: @@ -279,7 +287,16 @@ feature: {% endif %} {% if rightCycle %} -
      • {{ keyTrans('cycleway:right') }}:
          +
        • {{ keyTrans('cycleway:right') }}: + + {% if const.types[rightCycle].warning %} +
          {{ const.types[rightCycle].warning }}
          + {% elseif not const.types[rightCycle] %} +
          Invalid tag cycleway:right={{ attribute(tags, 'cycleway:right') }}.
          +
          Unknown
          + {% endif %} + +
          • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}
          • {{ keyTrans('cycleway:width') }}: @@ -330,16 +347,24 @@ const: width: 8 lane: color: '#00df3f' + track: + color: '#009f00' + shared: + color: '#ff0000' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' shared_lane: color: '#003faf' share_busway: color: '#ff7f00' opposite: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' opposite_lane: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no or cycleway=lane, cycleway:oneway=-1 instead.' - track: + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' + opposite_share_busway: + color: '#ff0000' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=share_busway, cycleway:oneway=-1 instead.' + opposite_track: color: '#ff0000' - warning: 'Deprecated tag! Consider tagging as separate way with highway=cycleway.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=track, cycleway:oneway=-1 instead.' From f14aacdc1637714c4f98af6113c07bfa29521272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 25 Jul 2024 07:35:32 +0200 Subject: [PATCH 17/41] cycleway_types: include left/right in warnings --- cycleway_types.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 7ff5f3d..4543616 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -266,7 +266,7 @@ feature:
          • {{ keyTrans('cycleway:left') }}: {% if const.types[leftCycle].warning %} -
            {{ const.types[leftCycle].warning }}
            +
            {{ const.types[leftCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'left'}) }}
            {% elseif not const.types[leftCycle] %}
            Invalid tag cycleway:left={{ attribute(tags, 'cycleway:left') }}.
            {% endif %} @@ -290,7 +290,7 @@ feature:
          • {{ keyTrans('cycleway:right') }}: {% if const.types[rightCycle].warning %} -
            {{ const.types[rightCycle].warning }}
            +
            {{ const.types[rightCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'right'}) }}
            {% elseif not const.types[rightCycle] %}
            Invalid tag cycleway:right={{ attribute(tags, 'cycleway:right') }}.
            Unknown
            @@ -358,13 +358,13 @@ const: color: '#ff7f00' opposite: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.' opposite_lane: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.' opposite_share_busway: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=share_busway, cycleway:oneway=-1 instead.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=share_busway, cycleway:%other_driving_side%:oneway=-1 instead.' opposite_track: color: '#ff0000' - warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=track, cycleway:oneway=-1 instead.' + warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.' From e0ca0c52be056a7809b8593c7b93802d88354d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 28 Jul 2024 10:26:26 +0200 Subject: [PATCH 18/41] cycleway_types: consider tags.cycleway --- cycleway_types.yaml | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) 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: |
              + {% if tags.cycleway %} +
            • + {{ keyTrans('cycleway') }}: +
              Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.
              +
                +
              • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
              • +
              +
            • + {% endif %} {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
            • {{ keyTrans('cycleway:width') }}: @@ -262,7 +296,7 @@ feature:
            • {% endif %} - {% if leftCycle %} + {% if attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
            • {{ keyTrans('cycleway:left') }}: {% if const.types[leftCycle].warning %} @@ -286,7 +320,7 @@ feature:
          • {% endif %} - {% if rightCycle %} + {% if attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
          • {{ keyTrans('cycleway:right') }}: {% if const.types[rightCycle].warning %} From f73a7cfb112ef800da8b5ce26ff833a63e80b604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 28 Jul 2024 10:29:24 +0200 Subject: [PATCH 19/41] cycleway_types: list marker --- cycleway_types.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index ce96f42..08dcd6f 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -347,6 +347,7 @@ feature:
          markerSymbol: '' + listMarkerSymbol: line info: | From 0b3331c6def56de07a6dd0e7e5e01ada5874d0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 28 Jul 2024 10:30:59 +0200 Subject: [PATCH 20/41] cycleway_types, cycleway_width: translation --- lang/en.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lang/en.json b/lang/en.json index 7db67ab..c0d4eb5 100644 --- a/lang/en.json +++ b/lang/en.json @@ -26,6 +26,8 @@ "category:cycle_amenities": "Amenities", "category:cycle_directions": "Directions", "category:cycle_routes": "Cycle Routes", + "category:cycleway_types": "Cycleway Types", + "category:cycleway_width": "Cycleway Width", "category:developable_areas": "Developable Areas", "category:developments": "Planning and Construction", "category:education": "Educational Services", From 9ae340524952c1557f025211f827cfaf37092c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 28 Nov 2024 13:23:29 +0100 Subject: [PATCH 21/41] cycleway_types, cycleway_width: also handle highway=path, bicycle=* --- cycleway_types.yaml | 5 +++++ cycleway_width.yaml | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 08dcd6f..e995ada 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[highway=path][bicycle][bicycle!=no]; way["cycleway"]["cycleway"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; @@ -12,6 +13,10 @@ feature: pre: | {% set type = tags.highway %} + {% if tags.highway == 'path' and tags.bicycle and tags.bicycle != 'no' %} + {% set type = 'cycleway' %} + {% endif %} + {% if tags.cyclestreet == 'yes' %} {% set type = 'cyclestreet' %} {% elseif tags.bicycle_road in ['yes', 'designated'] %} diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 956c58a..868a465 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -1,6 +1,7 @@ query: | ( way[highway=cycleway]; + way[highway=path][bicycle][bicycle!=no]; way["cycleway:width"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; @@ -10,6 +11,12 @@ feature: pre: | {% set driving_side = 'right' %} + {% set type = tags.highway %} + + {% if tags.highway == 'path' and tags.bicycle and tags.bicycle != 'no' %} + {% set type = 'cycleway' %} + {% endif %} + {% set width = attribute(tags, 'cycleway:width') %} {% if width matches "/'$/" %} {% set width = (width|slice(0, -1)) * 0.3048 %} @@ -49,7 +56,7 @@ feature: style: width: 4 opacity: | - {{ tags.highway == 'cycleway' or attribute(tags, 'cycleway:width') ? 1 : 0 }} + {{ type == 'cycleway' or attribute(tags, 'cycleway:width') ? 1 : 0 }} color: | {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %} {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %} @@ -67,7 +74,7 @@ feature: noClip: | {{ tags.oneway in ['yes', 1, -1] }} pattern: | - {% if tags.highway == 'cycleway' or attribute(tags, 'cycleway:width') %} + {% if type == 'cycleway' or attribute(tags, 'cycleway:width') %} {% if tags.oneway in ['yes', 1, -1] %}arrowHead{% endif %} {% endif %} pattern-offset: | @@ -161,7 +168,7 @@ feature: markerSymbol: false listMarkerSymbol: line description: | - {{ tagTrans('highway', tags.highway) }} + {{ tagTrans('highway', type) }} details: | {% if not attribute(tags, 'cycleway:width') %} {% elseif attribute(tags, 'cycleway:width') matches "/'$/" %} @@ -171,7 +178,7 @@ feature: {% endif %} body: |
            - {% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %} + {% if type in ['cycleway'] or attribute(tags, 'cycleway:width') %}
          • {{ keyTrans('cycleway:width') }}: {% if not attribute(tags, 'cycleway:width') %} From 27c30b7543c0dc5f97e923d6bfd7c58185f39bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Thu, 28 Nov 2024 13:27:52 +0100 Subject: [PATCH 22/41] cycleway_width: use tag 'width' as fallback of width --- cycleway_width.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cycleway_width.yaml b/cycleway_width.yaml index 868a465..b93d417 100644 --- a/cycleway_width.yaml +++ b/cycleway_width.yaml @@ -17,7 +17,7 @@ feature: {% set type = 'cycleway' %} {% endif %} - {% set width = attribute(tags, 'cycleway:width') %} + {% set width = attribute(tags, 'cycleway:width')|default(tags.width) %} {% if width matches "/'$/" %} {% set width = (width|slice(0, -1)) * 0.3048 %} {% endif %} From 3f843459a868c05006024fabf5f894c3e9229f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 30 Nov 2024 08:09:45 +0100 Subject: [PATCH 23/41] cycleway_types: indicate crossings and bridges --- cycleway_types.yaml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index e995ada..8a29677 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -33,7 +33,8 @@ feature: {% 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') %} + {% if tags.cycleway in ['crossing'] %} + {% elseif (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 %} @@ -79,6 +80,14 @@ feature: {% endif %} styles: | + {% if tags.bridge and tags.bridge != 'no' %} + bridge, + {% endif %} + + {% if tags.cycleway in ['crossing'] or tags.path in ['crossing'] %} + crossing, + {% endif %} + {% if tags.segregated %} footway, {% endif %} @@ -266,6 +275,21 @@ feature: pattern-path-fillOpacity: 1 + style:crossing: + width: | + {{ const.types[type].width + 4 }} + color: black + lineCap: butt + dashArray: "4,4" + zIndex: -0.1 + + style:bridge: + width: | + {{ const.types[type].width|default(5) + 4 }} + color: black + lineCap: butt + zIndex: -0.2 + description: | {% if tags.cyclestreet == 'yes' %} {{ keyTrans('cyclestreet') }} @@ -279,7 +303,11 @@ feature: body: |
              - {% if tags.cycleway %} + {% if tags.cycleway in ['crossing'] %} +
            • + {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }} +
            • + {% elseif tags.cycleway and not tags.cycleway in ['crossing'] %}
            • {{ keyTrans('cycleway') }}:
              Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.
              From a4286e7304a6bb5b47cfecfc83a30b04a78a5528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 30 Nov 2024 08:13:33 +0100 Subject: [PATCH 24/41] cycleway_types: stack lines via tags.layer --- cycleway_types.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 8a29677..053f1c2 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -167,6 +167,9 @@ feature: pattern-path-fillOpacity: 1 + zIndex: |- + {{ tags.layer|default(0) }} + style:footway: color: | {{ const.types.footway.color }} @@ -209,6 +212,9 @@ feature: {{ (const.types.footway.width / 2 - 1) * -1 }} {% endif %} + zIndex: |- + {{ tags.layer|default(0) }} + style:left: offset: -5 @@ -242,6 +248,9 @@ feature: pattern-path-fillOpacity: 1 + zIndex: |- + {{ tags.layer|default(0) }} + style:right: offset: 5 @@ -275,20 +284,25 @@ feature: pattern-path-fillOpacity: 1 + zIndex: |- + {{ tags.layer|default(0) }} + style:crossing: width: | {{ const.types[type].width + 4 }} color: black lineCap: butt dashArray: "4,4" - zIndex: -0.1 + zIndex: |- + {{ tags.layer|default(0) - 0.1 }} style:bridge: width: | {{ const.types[type].width|default(5) + 4 }} color: black lineCap: butt - zIndex: -0.2 + zIndex: |- + {{ tags.layer|default(0) - 0.2 }} description: | {% if tags.cyclestreet == 'yes' %} From 5b2cae63da333ae9539bfc6ca12116872e784090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sat, 30 Nov 2024 08:39:25 +0100 Subject: [PATCH 25/41] cycleway_types: in popup show cycleway:xxx=no and similar tags --- cycleway_types.yaml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 053f1c2..f7682b2 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -343,7 +343,7 @@ feature:
            • {% endif %} - {% if attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} + {% if leftCycle %}
            • {{ keyTrans('cycleway:left') }}: {% if const.types[leftCycle].warning %} @@ -365,9 +365,11 @@ feature: {% endif %}
          • + {% elseif attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} +
          • {{ keyTrans('cycleway:left') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}
          • {% endif %} - {% if attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} + {% if rightCycle %}
          • {{ keyTrans('cycleway:right') }}: {% if const.types[rightCycle].warning %} @@ -390,7 +392,10 @@ feature: {% endif %}
          + {% elseif attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} +
        • {{ keyTrans('cycleway:right') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}
        • {% endif %} + markerSymbol: '' From 0f410a278efaec36562d87c6f63f7b341df0dccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:16:07 +0100 Subject: [PATCH 26/41] cycleway_types: add const for 'hiddenTypes' (e.g. 'no', 'separate') --- cycleway_types.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index f7682b2..c3a664e 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -55,7 +55,7 @@ feature: {% set leftCycle1 = attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %} {% if leftCycle1 %}{% set leftCycle = leftCycle1 %}{% endif %} - {% if leftCycle in ['no', 'separate'] %} + {% if const.hiddenTypes[leftCycle] %} {% set leftCycle = '' %} {% endif %} @@ -68,7 +68,7 @@ feature: {% set rightCycle1 = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %} {% if rightCycle1 %}{% set rightCycle = rightCycle1 %}{% endif %} - {% if rightCycle in ['no', 'separate'] %} + {% if const.hiddenTypes[rightCycle] %} {% set rightCycle = '' %} {% endif %} @@ -455,3 +455,6 @@ const: opposite_track: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.' + hiddenTypes: + 'no': true + separate: true From 7810bcb4513deb29c84f9541770e27ce32f1f1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:21:16 +0100 Subject: [PATCH 27/41] cycleway_types: instead of 'crossing' introduce a more general 'otherInfrastructure' --- cycleway_types.yaml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index c3a664e..d9f0bb8 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -33,7 +33,8 @@ feature: {% set leftCycle = '' %}{% set rightCycle = '' %} {% if tags.cycleway %} - {% if tags.cycleway in ['crossing'] %} + {% if const.otherInfrastructure[tags.cycleway] %} + {# skip #} {% elseif (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/' %} @@ -84,8 +85,8 @@ feature: bridge, {% endif %} - {% if tags.cycleway in ['crossing'] or tags.path in ['crossing'] %} - crossing, + {% if const.otherInfrastructure[tags.cycleway|default(tags.path)] %} + other, {% endif %} {% if tags.segregated %} @@ -287,12 +288,15 @@ feature: zIndex: |- {{ tags.layer|default(0) }} - style:crossing: + style:other: width: | - {{ const.types[type].width + 4 }} - color: black - lineCap: butt - dashArray: "4,4" + {{ const.types[type].width + const.otherInfrastructure[tags.cycleway].extraWidth }} + color: | + {{ const.otherInfrastructure[tags.cycleway].color }} + lineCap: | + {{ const.otherInfrastructure[tags.cycleway].lineCap|default('round') }} + dashArray: | + {{ const.otherInfrastructure[tags.cycleway].dashArray|default('') }} zIndex: |- {{ tags.layer|default(0) - 0.1 }} @@ -317,11 +321,11 @@ feature: body: |
            - {% if tags.cycleway in ['crossing'] %} + {% if const.otherInfrastructure[tags.cycleway] %}
          • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
          • - {% elseif tags.cycleway and not tags.cycleway in ['crossing'] %} + {% elseif tags.cycleway %}
          • {{ keyTrans('cycleway') }}:
            Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.
            @@ -455,6 +459,12 @@ const: opposite_track: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.' + otherInfrastructure: + crossing: + extraWidth: 4 + lineCap: butt + dashArray: '4,4' + color: black hiddenTypes: 'no': true separate: true From 00fd3e56a243b9b5ec9372a86d8acaca1f1d5b4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:25:36 +0100 Subject: [PATCH 28/41] cycleway: fix markerSymbol by forcing '0' for offset --- cycleway_types.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index d9f0bb8..2ac1ced 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -138,6 +138,8 @@ feature: offset: | {% if tags.segregated == 'yes' %} {{ const.types[type].width / 2 - 1 }} + {% else %} + 0 {% endif %} pattern: | @@ -297,6 +299,7 @@ feature: {{ const.otherInfrastructure[tags.cycleway].lineCap|default('round') }} dashArray: | {{ const.otherInfrastructure[tags.cycleway].dashArray|default('') }} + offset: 0 zIndex: |- {{ tags.layer|default(0) - 0.1 }} From ba35dc1d73fbc5195bb8dac0bcb8fb5d59a0feec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:30:11 +0100 Subject: [PATCH 29/41] cycleway_types: improve bridge rendering --- cycleway_types.yaml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 2ac1ced..4cfad6c 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -82,7 +82,7 @@ feature: styles: | {% if tags.bridge and tags.bridge != 'no' %} - bridge, + bridge_outer,bridge_inner, {% endif %} {% if const.otherInfrastructure[tags.cycleway|default(tags.path)] %} @@ -303,11 +303,19 @@ feature: zIndex: |- {{ tags.layer|default(0) - 0.1 }} - style:bridge: + style:bridge_outer: width: | - {{ const.types[type].width|default(5) + 4 }} + {{ const.types[type].width|default(5) + 8 }} color: black lineCap: butt + zIndex: |- + {{ tags.layer|default(0) - 0.21 }} + + style:bridge_inner: + width: | + {{ const.types[type].width|default(5) + 4 }} + color: white + lineCap: butt zIndex: |- {{ tags.layer|default(0) - 0.2 }} From 9b6fd9f0c1c190c26b54678fb752d541e48704d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:35:12 +0100 Subject: [PATCH 30/41] cycleway_types: handle cycleway=traffic_island and cycleway=link/sidepath --- cycleway_types.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 4cfad6c..ba2f311 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -476,6 +476,12 @@ const: lineCap: butt dashArray: '4,4' color: black + traffic_island: + extraWidth: 2 + lineCap: butt + color: 'black' hiddenTypes: 'no': true separate: true + sidepath: true + link: true From cd41134110524749439d608438ea9a3706adcf86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 08:35:32 +0100 Subject: [PATCH 31/41] cycleway_types: improve info --- cycleway_types.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index ba2f311..cc9d694 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -423,6 +423,7 @@ info: |
          {% for k, v in const.types %} + {% if not v.hideInfo %} + {% endif %} {% endfor %} + + {% for k, v in const.otherInfrastructure %} + + + + + {% endfor %} + + + + +
          {{ markerLine({ width: 4, color: v.color }) }} @@ -431,7 +432,28 @@ info: | {{ k }}
          + {{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }} + + {{ k }} +
          + {{ markerLine({ width: 4, color: '#ff0000' }) }} + + Deprecated or invalid tag! +
          const: types: @@ -454,6 +476,7 @@ const: shared: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway=lane, cycleway:oneway=-1 instead.' + hideInfo: true shared_lane: color: '#003faf' share_busway: @@ -461,15 +484,19 @@ const: opposite: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.' + hideInfo: true opposite_lane: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.' + hideInfo: true opposite_share_busway: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=share_busway, cycleway:%other_driving_side%:oneway=-1 instead.' + hideInfo: true opposite_track: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=track, cycleway:%other_driving_side%:oneway=-1 instead.' + hideInfo: true otherInfrastructure: crossing: extraWidth: 4 From 0203f0a0547768f4e1e80768458b717d41f72722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 10:22:38 +0100 Subject: [PATCH 32/41] cycleway_types: fix popup for cycleway=* (with indication for left/right/both) and cycleway=yes --- cycleway_types.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index cc9d694..26e2fd4 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -336,7 +336,7 @@ feature:
        • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
        • - {% elseif tags.cycleway %} + {% elseif tags.cycleway and tags.cycleway != 'yes' %}
        • {{ keyTrans('cycleway') }}:
          Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.
          @@ -358,7 +358,7 @@ feature:
        • {% endif %} - {% if leftCycle %} + {% if leftCycle and attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
        • {{ keyTrans('cycleway:left') }}: {% if const.types[leftCycle].warning %} @@ -384,7 +384,7 @@ feature:
        • {{ keyTrans('cycleway:left') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}
        • {% endif %} - {% if rightCycle %} + {% if rightCycle and attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
        • {{ keyTrans('cycleway:right') }}: {% if const.types[rightCycle].warning %} @@ -509,6 +509,7 @@ const: color: 'black' hiddenTypes: 'no': true + 'yes': true separate: true sidepath: true link: true From 1f183851c2dfc36ea39e4e3c77fd8a4a562ad1a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 10:23:41 +0100 Subject: [PATCH 33/41] cycleway_types: add cycleway=shoulder --- cycleway_types.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 26e2fd4..dcb1405 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -481,6 +481,8 @@ const: color: '#003faf' share_busway: color: '#ff7f00' + shoulder: + color: '#7f00ff' opposite: color: '#ff0000' warning: 'Deprecated tag! Use oneway:bicycle=no and cycleway:%other_driving_side%=lane, cycleway:%other_driving_side%:oneway=-1 instead.' From cf4037b94c27fa97ddd52aa643e54940fc8bfff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 10:52:08 +0100 Subject: [PATCH 34/41] cycleway_types: improve rendering of oneway --- cycleway_types.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index dcb1405..57697eb 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -23,6 +23,13 @@ feature: {% set type = 'bicycle_road' %} {% endif %} + {% set mainOneway = tags.oneway %} + {% if mainOneway == 'yes' %} + {% set mainOneway = 1 %} + {% elseif mainOneway == 'no' %} + {% set mainOneway = 0 %} + {% endif %} + {% set oneway = attribute(tags, 'oneway:bicycle')|default(tags.oneway) %} {% if oneway == 'yes' %} {% set oneway = 1 %} @@ -80,6 +87,12 @@ feature: {% set rightOneway = 0 %} {% endif %} + {% if mainOneway and ((not rightCycle and mainOneway == rightOneway) or (not leftCycle and mainOneway == leftOneway)) %} + {% set oneway = mainOneway %} + {% elseif mainOneway == oneway and ((rightCycle and mainOneway == rightOneway) or (leftCycle and mainOneway == leftOneway)) %} + {% set oneway = 0 %} + {% endif %} + styles: | {% if tags.bridge and tags.bridge != 'no' %} bridge_outer,bridge_inner, From 56b33368a8e4f5fb9f3c36c83be1fc866f46a0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 11:00:53 +0100 Subject: [PATCH 35/41] cycleway_types: different color for share_busway --- cycleway_types.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 57697eb..f7ade3e 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -493,7 +493,7 @@ const: shared_lane: color: '#003faf' share_busway: - color: '#ff7f00' + color: '#007faf' shoulder: color: '#7f00ff' opposite: From 1ac38968b3bf7db40a49592ac89a7bd9fe25b012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 12:59:21 +0100 Subject: [PATCH 36/41] cycleway_types: bugfix oneway again --- cycleway_types.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index f7ade3e..b15d165 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -93,6 +93,10 @@ feature: {% set oneway = 0 %} {% endif %} + {% if oneway and attribute(tags, 'oneway:bicycle') == 'no' and not rightCycle and not leftCycle %} + {% set oneway = 0 %} + {% endif %} + styles: | {% if tags.bridge and tags.bridge != 'no' %} bridge_outer,bridge_inner, From 65dae320125ab687fc2e045709c4f57cd8a5cc36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 13:01:44 +0100 Subject: [PATCH 37/41] cycleway_types: in info, show width of ways --- cycleway_types.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index b15d165..128776d 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -443,7 +443,7 @@ info: | {% if not v.hideInfo %}
  • - {{ markerLine({ width: 4, color: v.color }) }} + {{ markerLine({ width: v.width|default(4), color: v.color }) }} {{ k }} From e74306d5faebdb0f25704fecd828c2daaa960378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 13:09:56 +0100 Subject: [PATCH 38/41] cycleway_types: label info --- cycleway_types.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 128776d..ecb93f0 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -446,7 +446,12 @@ info: | {{ markerLine({ width: v.width|default(4), color: v.color }) }} - {{ k }} + {% set label = v.label|default(k|split('=') > 1 ? k : ('cycleway=' ~ k)) %} + {% if label|split('=') > 1 %} + {{ tagTrans(label|split('=')[0], label|split('=')[1]) }} + {% else %} + {{ keyTrans(label) }} + {% endif %}
    - {{ k }} + {{ tagTrans('cycleway', k) }}
    const: types: - cycleway: - color: '#009f00' - width: 4 - footway: - color: '#ff9f00' - width: 4 cyclestreet: color: '#006f3f' width: 8 @@ -493,6 +492,15 @@ const: color: '#006f4f' width: 8 label: bicycle_road + highway=living_street: + color: '#ff9f00' + width: 8 + cycleway: + color: '#009f00' + width: 4 + footway: + color: '#ff9f00' + width: 4 lane: color: '#00df3f' track: From 4e80e13360b376ecddf8d2642efcd81c9aae0dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 21:39:23 +0100 Subject: [PATCH 40/41] cycleway_types: deprecated warning for cycleway=opposite --- cycleway_types.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cycleway_types.yaml b/cycleway_types.yaml index 55a63bd..07835b7 100644 --- a/cycleway_types.yaml +++ b/cycleway_types.yaml @@ -362,6 +362,10 @@ feature:
  • {{ keyTrans('cycleway') }}:
    Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.
    + {% if const.types[tags.cycleway].warning %} +
    {{ const.types[tags.cycleway].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'both'}) }}
    + {% endif %} +
    • {{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
    From d34faa53b3ff00d78af7a342e179bd6f1cf099ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 1 Dec 2024 21:42:04 +0100 Subject: [PATCH 41/41] cycleway_width: hide from index, as category is not ready yet --- index.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/index.json b/index.json index 7c09b74..2c90c69 100644 --- a/index.json +++ b/index.json @@ -190,9 +190,6 @@ }, { "id": "cycleway_types" - }, - { - "id": "cycleway_width" } ] },