43 Commits

Author SHA1 Message Date
Stephan Bösch-Plepelits 16dc8bc69e cycleway_types: add labels for highway=footway, highway=cycleway 3 weeks ago
Stephan Bösch-Plepelits 4aad8533b8 Merge branch 'cycleway' 3 weeks ago
Stephan Bösch-Plepelits d34faa53b3 cycleway_width: hide from index, as category is not ready yet 3 weeks ago
Stephan Bösch-Plepelits 4e80e13360 cycleway_types: deprecated warning for cycleway=opposite 3 weeks ago
Stephan Bösch-Plepelits 7fadb51676 cycleway_types: show highway=living_street 3 weeks ago
Stephan Bösch-Plepelits e74306d5fa cycleway_types: label info 3 weeks ago
Stephan Bösch-Plepelits 65dae32012 cycleway_types: in info, show width of ways 3 weeks ago
Stephan Bösch-Plepelits 1ac38968b3 cycleway_types: bugfix oneway again 3 weeks ago
Stephan Bösch-Plepelits 56b33368a8 cycleway_types: different color for share_busway 3 weeks ago
Stephan Bösch-Plepelits cf4037b94c cycleway_types: improve rendering of oneway 3 weeks ago
Stephan Bösch-Plepelits 1f183851c2 cycleway_types: add cycleway=shoulder 3 weeks ago
Stephan Bösch-Plepelits 0203f0a054 cycleway_types: fix popup for cycleway=* (with indication for left/right/both) and cycleway=yes 3 weeks ago
Stephan Bösch-Plepelits cd41134110 cycleway_types: improve info 3 weeks ago
Stephan Bösch-Plepelits 9b6fd9f0c1 cycleway_types: handle cycleway=traffic_island and cycleway=link/sidepath 3 weeks ago
Stephan Bösch-Plepelits ba35dc1d73 cycleway_types: improve bridge rendering 3 weeks ago
Stephan Bösch-Plepelits 00fd3e56a2 cycleway: fix markerSymbol by forcing '0' for offset 3 weeks ago
Stephan Bösch-Plepelits 7810bcb451 cycleway_types: instead of 'crossing' introduce a more general 'otherInfrastructure' 3 weeks ago
Stephan Bösch-Plepelits 0f410a278e cycleway_types: add const for 'hiddenTypes' (e.g. 'no', 'separate') 3 weeks ago
Stephan Bösch-Plepelits 5b2cae63da cycleway_types: in popup show cycleway:xxx=no and similar tags 3 weeks ago
Stephan Bösch-Plepelits a4286e7304 cycleway_types: stack lines via tags.layer 3 weeks ago
Stephan Bösch-Plepelits 3f843459a8 cycleway_types: indicate crossings and bridges 3 weeks ago
Stephan Bösch-Plepelits 27c30b7543 cycleway_width: use tag 'width' as fallback of width 3 weeks ago
Stephan Bösch-Plepelits 9ae3405249 cycleway_types, cycleway_width: also handle highway=path, bicycle=* 3 weeks ago
Stephan Bösch-Plepelits 0b3331c6de cycleway_types, cycleway_width: translation 5 months ago
Stephan Bösch-Plepelits f73a7cfb11 cycleway_types: list marker 5 months ago
Stephan Bösch-Plepelits e0ca0c52be cycleway_types: consider tags.cycleway 5 months ago
Stephan Bösch-Plepelits f14aacdc16 cycleway_types: include left/right in warnings 5 months ago
Stephan Bösch-Plepelits 23f6178d1d cycleway_types: print warnings for deprecated tags 5 months ago
Stephan Bösch-Plepelits e14b2de218 cycleway_types: info 5 months ago
Stephan Bösch-Plepelits b6530e334e cycleway_width: set unknownColor in const, add to info 5 months ago
Stephan Bösch-Plepelits f875570c47 cycleway_width: improve popup body 5 months ago
Stephan Bösch-Plepelits 2b10065074 cycleway_width: Show left/right cycleway 5 months ago
Stephan Bösch-Plepelits 465d3fb52f cycleway_width: improvements 5 months ago
Stephan Bösch-Plepelits b77d5c5efd cycleway_width: arrows for oneway cycleways 5 months ago
Stephan Bösch-Plepelits 73a491c6dd cycleway_width: configure values via const, map info 5 months ago
Stephan Bösch-Plepelits 4cb21285a4 cycleway_width: include unit, parse foot 5 months ago
Stephan Bösch-Plepelits 41ad6c0940 cycleway_width: initial commit 5 months ago
Stephan Bösch-Plepelits c09b60d86f cycleway_types: render cycleway:right 5 months ago
Stephan Bösch-Plepelits 64c752caa7 cycleway_types: show cycleway:left 5 months ago
Stephan Bösch-Plepelits e8c0ba1f9f cycleway_types: oneway 5 months ago
Stephan Bösch-Plepelits 321998e50f cycleway_types: include bicycle_road=* and cyclestreet=* 5 months ago
Stephan Bösch-Plepelits fe8837e52e cycleway_types: show cycleways with segregation 5 months ago
Stephan Bösch-Plepelits d3075253f4 cycleway_types: new category 5 months ago
  1. 555
      cycleway_types.yaml
  2. 266
      cycleway_width.yaml
  3. 3
      index.json
  4. 2
      lang/en.json

555
cycleway_types.yaml

@ -0,0 +1,555 @@
query:
(
way[highway=cycleway];
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)"];
way["cycleway:both"]["cycleway:both"!~"(no|separate)"];
)
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'] %}
{% set type = 'bicycle_road' %}
{% elseif tags.highway and const.types['highway=' ~ tags.highway] %}
{% set type = 'highway=' ~ tags.highway %}
{% 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 %}
{% elseif oneway == 'no' %}
{% set oneway = 0 %}
{% endif %}
{% set leftCycle = '' %}{% set rightCycle = '' %}
{% if tags.cycleway %}
{% 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/' %}
{% 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 const.hiddenTypes[leftCycle] %}
{% 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 %}
{% set rightCycle1 = attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
{% if rightCycle1 %}{% set rightCycle = rightCycle1 %}{% endif %}
{% if const.hiddenTypes[rightCycle] %}
{% 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 %}
{% 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 %}
{% 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,
{% endif %}
{% if const.otherInfrastructure[tags.cycleway|default(tags.path)] %}
other,
{% endif %}
{% if tags.segregated %}
footway,
{% endif %}
default
{% if leftCycle %}
,left
{% endif %}
{% if rightCycle %}
,right
{% endif %}
style:
width: |
{% if tags.segregated == 'yes' %}
{{ const.types[type].width / 2 }}
{% else %}
{{ const.types[type].width }}
{% endif %}
dashArray: |
{% 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' or oneway %}
butt
{% else %}
round
{% endif %}
color: |
{{ const.types[type].color }}
offset: |
{% if tags.segregated == 'yes' %}
{{ const.types[type].width / 2 - 1 }}
{% else %}
0
{% 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
zIndex: |-
{{ tags.layer|default(0) }}
style:footway:
color: |
{{ const.types.footway.color }}
width: |
{% if tags.segregated == 'yes' %}
{{ const.types.footway.width / 2 }}
{% else %}
{{ const.types.footway.width }}
{% endif %}
dashArray: |
{% if oneway and tags.segregated == 'no' %}
5,5,5,5,5,10
{% elseif oneway %}
25,10
{% elseif tags.segregated == 'no' %}
5,5
{% endif %}
dashOffset: |
{% if oneway %}
10
{% elseif tags.segregated == 'no' %}
5
{% endif %}
noClip: |
{{ oneway != 0 }}
lineCap: |
{% if tags.segregated == 'no' or oneway %}
butt
{% else %}
round
{% endif %}
offset: |
{% if tags.segregated == 'yes' %}
{{ (const.types.footway.width / 2 - 1) * -1 }}
{% endif %}
zIndex: |-
{{ tags.layer|default(0) }}
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
zIndex: |-
{{ tags.layer|default(0) }}
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
zIndex: |-
{{ tags.layer|default(0) }}
style:other:
width: |
{{ 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('') }}
offset: 0
zIndex: |-
{{ tags.layer|default(0) - 0.1 }}
style:bridge_outer:
width: |
{{ 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 }}
description: |
{% if tags.cyclestreet == 'yes' %}
{{ 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 %}
{{ tagTrans('highway', tags.highway) }}
{% endif %}
body: |
<ul>
{% if const.otherInfrastructure[tags.cycleway] %}
<li>
{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}
</li>
{% elseif tags.cycleway and tags.cycleway != 'yes' %}
<li>
{{ keyTrans('cycleway') }}:
<div class='warning'>Recommendation: Indicate side of way by using 'cycleway:left' and/or 'cycleway:right'.</div>
{% if const.types[tags.cycleway].warning %}
<div class='warning'>{{ const.types[tags.cycleway].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'both'}) }}</div>
{% endif %}
<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', tags.cycleway) }}</li>
</ul>
</li>
{% endif %}
{% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
<li>
{{ 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 %}
</li>
{% endif %}
{% if leftCycle and attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
<li>{{ keyTrans('cycleway:left') }}:
{% if const.types[leftCycle].warning %}
<div class='warning'>{{ const.types[leftCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'left'}) }}</div>
{% elseif not const.types[leftCycle] %}
<div class='warning'>Invalid tag cycleway:left={{ attribute(tags, 'cycleway:left') }}.</div>
{% endif %}
<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
<li>
{{ 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 %}
</li>
</ul></li>
{% elseif attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both')) %}
<li>{{ keyTrans('cycleway:left') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
{% endif %}
{% if rightCycle and attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
<li>{{ keyTrans('cycleway:right') }}:
{% if const.types[rightCycle].warning %}
<div class='warning'>{{ const.types[rightCycle].warning|replace({'%driving_side%': map.driving_side, '%other_driving_side%': map.driving_side == 'right' ? 'left': 'right', '%current%': 'right'}) }}</div>
{% elseif not const.types[rightCycle] %}
<div class='warning'>Invalid tag cycleway:right={{ attribute(tags, 'cycleway:right') }}.</div>
<div class='warning'>Unknown</div>
{% endif %}
<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
<li>
{{ 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 %}
</li>
</ul></li>
{% elseif attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both')) %}
<li>{{ keyTrans('cycleway:right') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
{% endif %}
</ul>
markerSymbol: ''
listMarkerSymbol: line
info: |
<table>
<tr>
<th>Symbol</th>
<th></th>
</tr>
{% for k, v in const.types %}
{% if not v.hideInfo %}
<tr>
<td>
{{ markerLine({ width: v.width|default(4), color: v.color }) }}
</td>
<td>
{% 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 %}
</td>
</tr>
{% endif %}
{% endfor %}
{% for k, v in const.otherInfrastructure %}
<tr>
<td>
{{ markerLine(evaluate({ highway: 'cycleway', cycleway: k })) }}
</td>
<td>
{{ tagTrans('cycleway', k) }}
</td>
</tr>
{% endfor %}
<tr>
<td>
{{ markerLine({ width: 4, color: '#ff0000' }) }}
</td>
<td>
Deprecated or invalid tag!
</td>
</tr>
</table>
const:
types:
cyclestreet:
color: '#006f3f'
width: 8
label: cyclestreet
bicycle_road:
color: '#006f4f'
width: 8
label: bicycle_road
highway=living_street:
color: '#ff9f00'
width: 8
cycleway:
color: '#009f00'
width: 4
label: highway=cycleway
footway:
color: '#ff9f00'
width: 4
label: highway=footway
lane:
color: '#00df3f'
track:
color: '#009f00'
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:
color: '#007faf'
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.'
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
lineCap: butt
dashArray: '4,4'
color: black
traffic_island:
extraWidth: 2
lineCap: butt
color: 'black'
hiddenTypes:
'no': true
'yes': true
separate: true
sidepath: true
link: true

266
cycleway_width.yaml

@ -0,0 +1,266 @@
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)"];
way["cycleway:both"]["cycleway:both"!~"(no|separate)"];
)
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')|default(tags.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:
width: 4
opacity: |
{{ 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 %}
{% if width %}
{{ colorInterpolate(const.colorScheme, (width - minWidth) / (optWidth - minWidth)) }}
{% else %}{{ const.unknownColor }}
{% 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 type == '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
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 %}{{ const.unknownColor }}
{% 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 %}{{ const.unknownColor }}
{% 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 %}{{ const.unknownColor }}
{% 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 %}{{ const.unknownColor }}
{% 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 %}{{ const.unknownColor }}
{% endif %}
pattern-path-fillOpacity: 1
markerSymbol: false
listMarkerSymbol: line
description: |
{{ tagTrans('highway', type) }}
details: |
{% if not attribute(tags, 'cycleway:width') %}
{% elseif attribute(tags, 'cycleway:width') matches "/'$/" %}
{{ attribute(tags, 'cycleway:width') }}
{% else %}
{{ attribute(tags, 'cycleway:width') }}m
{% endif %}
body: |
<ul>
{% if type in ['cycleway'] or attribute(tags, 'cycleway:width') %}
<li>
{{ 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 %}
</li>
{% endif %}
{% if leftCycle %}
<li>{{ keyTrans('cycleway:left') }}:<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:left')|default(attribute(tags, 'cycleway:both'))) }}</li>
<li>
{{ 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 %}
</li>
</ul></li>
{% endif %}
{% if rightCycle %}
<li>{{ keyTrans('cycleway:right') }}:<ul>
<li>{{ keyTrans('cycleway') }}: {{ tagTrans('cycleway', attribute(tags, 'cycleway:right')|default(attribute(tags, 'cycleway:both'))) }}</li>
<li>
{{ 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 %}
</li>
</ul></li>
{% endif %}
</ul>
info: |
<table>
<tr>
<th>Symbol</th>
<th>{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'yes') }}</th>
<th>{{ keyTrans('oneway') }}={{ tagTrans('oneway', 'no') }}</th>
</tr>
<tr>
<td>
{{ markerLine({ width: 4, color: const.unknownColor }) }}
</td>
<td>
{{ trans('unknown') }}
</td>
<td>
{{ trans('unknown') }}
</td>
</tr>
{% for v in range(0, 1, 0.25) %}
<tr>
<td>
{{ markerLine({ width: 4, color: colorInterpolate(const.colorScheme, v) }) }}
</td>
<td>
{% if v == 0 %}<={% elseif v == 1 %}>={% endif %}
{{ (const.minWidthOneway + (v * (const.optWidthOneway - const.minWidthOneway)))|number_format(2) }}m
</td>
<td>
{% if v == 0 %}<={% elseif v == 1 %}>={% endif %}
{{ (const.minWidthBoth + (v * (const.optWidthBoth - const.minWidthBoth)))|number_format(2) }}m
</td>
</tr>
{% endfor %}
</table>
const:
minWidthBoth: 1.5
optWidthBoth: 5
minWidthOneway: 0.75
optWidthOneway: 3
colorScheme: ['#ff0000', '#ff00ff', '#0000ff']
unknownColor: black

3
index.json

@ -243,6 +243,9 @@
}, },
{ {
"id": "cycle_routes" "id": "cycle_routes"
},
{
"id": "cycleway_types"
} }
] ]
}, },

2
lang/en.json

@ -92,6 +92,8 @@
"category:cycle_amenities": "Amenities", "category:cycle_amenities": "Amenities",
"category:cycle_directions": "Directions", "category:cycle_directions": "Directions",
"category:cycle_routes": "Cycle Routes", "category:cycle_routes": "Cycle Routes",
"category:cycleway_types": "Cycleway Types",
"category:cycleway_width": "Cycleway Width",
"category:developable_areas": "Developable Areas", "category:developable_areas": "Developable Areas",
"category:education": "Educational Services", "category:education": "Educational Services",
"category:electric_power": "Electric Power", "category:electric_power": "Electric Power",

Loading…
Cancel
Save