Browse Source

cycleway_types, cycleway_width: also handle highway=path, bicycle=*

cycleway
parent
commit
9ae3405249
  1. 5
      cycleway_types.yaml
  2. 15
      cycleway_width.yaml

5
cycleway_types.yaml

@ -3,6 +3,7 @@ query:
way[highway=cycleway]; way[highway=cycleway];
way[cyclestreet=yes]; way[cyclestreet=yes];
way[bicycle_road=yes]; way[bicycle_road=yes];
way[highway=path][bicycle][bicycle!=no];
way["cycleway"]["cycleway"!~"(no|separate)"]; way["cycleway"]["cycleway"!~"(no|separate)"];
way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"];
way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"];
@ -12,6 +13,10 @@ feature:
pre: | pre: |
{% set type = tags.highway %} {% set type = tags.highway %}
{% if tags.highway == 'path' and tags.bicycle and tags.bicycle != 'no' %}
{% set type = 'cycleway' %}
{% endif %}
{% if tags.cyclestreet == 'yes' %} {% if tags.cyclestreet == 'yes' %}
{% set type = 'cyclestreet' %} {% set type = 'cyclestreet' %}
{% elseif tags.bicycle_road in ['yes', 'designated'] %} {% elseif tags.bicycle_road in ['yes', 'designated'] %}

15
cycleway_width.yaml

@ -1,6 +1,7 @@
query: | query: |
( (
way[highway=cycleway]; way[highway=cycleway];
way[highway=path][bicycle][bicycle!=no];
way["cycleway:width"]; way["cycleway:width"];
way["cycleway:left"]["cycleway:left"!~"(no|separate)"]; way["cycleway:left"]["cycleway:left"!~"(no|separate)"];
way["cycleway:right"]["cycleway:right"!~"(no|separate)"]; way["cycleway:right"]["cycleway:right"!~"(no|separate)"];
@ -10,6 +11,12 @@ feature:
pre: | pre: |
{% set driving_side = 'right' %} {% 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') %} {% set width = attribute(tags, 'cycleway:width') %}
{% if width matches "/'$/" %} {% if width matches "/'$/" %}
{% set width = (width|slice(0, -1)) * 0.3048 %} {% set width = (width|slice(0, -1)) * 0.3048 %}
@ -49,7 +56,7 @@ feature:
style: style:
width: 4 width: 4
opacity: | opacity: |
{{ tags.highway == 'cycleway' or attribute(tags, 'cycleway:width') ? 1 : 0 }}
{{ type == 'cycleway' or attribute(tags, 'cycleway:width') ? 1 : 0 }}
color: | color: |
{% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %} {% set minWidth = tags.oneway in ['yes', 1, -1] ? const.minWidthOneway : const.minWidthBoth %}
{% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %} {% set optWidth = tags.oneway in ['yes', 1, -1] ? const.optWidthOneway : const.optWidthBoth %}
@ -67,7 +74,7 @@ feature:
noClip: | noClip: |
{{ tags.oneway in ['yes', 1, -1] }} {{ tags.oneway in ['yes', 1, -1] }}
pattern: | 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 %} {% if tags.oneway in ['yes', 1, -1] %}arrowHead{% endif %}
{% endif %} {% endif %}
pattern-offset: | pattern-offset: |
@ -161,7 +168,7 @@ feature:
markerSymbol: false markerSymbol: false
listMarkerSymbol: line listMarkerSymbol: line
description: | description: |
{{ tagTrans('highway', tags.highway) }}
{{ tagTrans('highway', type) }}
details: | details: |
{% if not attribute(tags, 'cycleway:width') %} {% if not attribute(tags, 'cycleway:width') %}
{% elseif attribute(tags, 'cycleway:width') matches "/'$/" %} {% elseif attribute(tags, 'cycleway:width') matches "/'$/" %}
@ -171,7 +178,7 @@ feature:
{% endif %} {% endif %}
body: | body: |
<ul> <ul>
{% if tags.highway in ['cycleway'] or attribute(tags, 'cycleway:width') %}
{% if type in ['cycleway'] or attribute(tags, 'cycleway:width') %}
<li> <li>
{{ keyTrans('cycleway:width') }}: {{ keyTrans('cycleway:width') }}:
{% if not attribute(tags, 'cycleway:width') %} {% if not attribute(tags, 'cycleway:width') %}

Loading…
Cancel
Save