From c3862640cea04fb243543d07e64e6a4f7028f591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Wed, 18 Jan 2023 07:37:41 +0100 Subject: [PATCH] parking_lanes: support deprecated tagging (with warning) --- parking_lanes.yaml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/parking_lanes.yaml b/parking_lanes.yaml index 8efdc48..087bc47 100644 --- a/parking_lanes.yaml +++ b/parking_lanes.yaml @@ -1,12 +1,22 @@ query: 10: | - (way["parking:left"];way["parking:right"];way["parking:both"];) + ( + way["parking:left"];way["parking:right"];way["parking:both"]; + way["parking:lane:left"];way["parking:lane:right"];way["parking:lane:both"]; + ) feature: pre: | - {% set leftType = attribute(tags, 'parking:left')|default(attribute(tags, 'parking:both'))|default('unknown') %} - {% set rightType = attribute(tags, 'parking:right')|default(attribute(tags, 'parking:both'))|default('unknown') %} - {% set leftOrientation = attribute(tags, 'parking:left:orientation')|default(attribute(tags, 'parking:both:orientation'))|default('unknown') %} - {% set rightOrientation = attribute(tags, 'parking:right:orientation')|default(attribute(tags, 'parking:both:orientation'))|default('unknown') %} + {% set deprecated = attribute(tags, 'parking:lane:left') or attribute(tags, 'parking:lane:right') or attribute(tags, 'parking:lane:both') %} + {% set leftOrientation = attribute(tags, 'parking:left:orientation')|default(attribute(tags, 'parking:lane:left'))|default(attribute(tags, 'parking:both:orientation'))|default(attribute(tags, 'parking:lane:both'))|default('unknown') %} + {% set rightOrientation = attribute(tags, 'parking:right:orientation')|default(attribute(tags, 'parking:lane:right'))|default(attribute(tags, 'parking:both:orientation'))|default(attribute(tags, 'parking:lane:both'))|default('unknown') %} + {% set leftType = attribute(tags, 'parking:left')|default(attribute(tags, 'parking:lane:left:' ~ leftOrientation))|default(attribute(tags, 'parking:both'))|default(attribute(tags, 'parking:lane:both:' ~ leftOrientation))|default('unknown') %} + {% set rightType = attribute(tags, 'parking:right')|default(attribute(tags, 'parking:lane:right:' ~ rightOrientation))|default(attribute(tags, 'parking:both'))|default(attribute(tags, 'parking:lane:both:' ~ rightOrientation))|default('unknown') %} + {% if (attribute(tags, 'parking:lane:left:' ~ leftOrientation) or attribute(tags, 'parking:lane:both:' ~ leftOrientation)) and leftType == 'on_street' %} + {% set leftType = 'lane' %} + {% endif %} + {% if (attribute(tags, 'parking:lane:right:' ~ rightOrientation) or attribute(tags, 'parking:lane:both:' ~ rightOrientation)) and rightType == 'on_street' %} + {% set rightType = 'lane' %} + {% endif %} {% set leftCondition = 'undefined' %} {% if attribute(tags, 'parking:left:fee')|default(attribute(tags, 'parking:both:fee')) == 'no' %} @@ -77,6 +87,7 @@ feature:
  • Orientation: {{ rightOrientation }}
  • {% endif %} + {% if deprecated %}
    {{ repoTrans('deprecated', 'parking:lane:left/right/both', 'https://wiki.openstreetmap.org/wiki/Key:parking:lane')|raw }}
    {% endif %} markerSymbol: '' listMarkerSymbol: line details: | @@ -86,14 +97,14 @@ feature: default {% if leftType == 'separate' %} ,leftSeparate - {% elseif leftType in ['no', 'unknown'] %} + {% elseif leftType in ['no', 'unknown'] and leftOrientation == 'unknown' %} ,leftType {% else %} ,leftType,leftOrientation {% endif %} {% if rightType == 'separate' %} ,rightSeparate - {% elseif rightType in ['no', 'unknown'] %} + {% elseif rightType in ['no', 'unknown'] and rightOrientation == 'unknown' %} ,rightType {% else %} ,rightType,rightOrientation