Ticket #21235: 0001-Fix-minor-issues-with-footway-validation.patch

File 0001-Fix-minor-issues-with-footway-validation.patch, 3.1 KB (added by JeroenHoek, 22 months ago)

Patch

  • resources/data/validator/highway.mapcss

    From 74652af609d95915827471c6dea18b694ade9474 Mon Sep 17 00:00:00 2001
    From: Jeroen Hoek <mail@jeroenhoek.nl>
    Date: Sat, 21 Aug 2021 09:19:13 +0200
    Subject: [PATCH] Fix minor issues with footway=* validation
    
    Add a check for `footway=separate`.
    Remove special treatment for `footway=none`, `none` is added to the general `footway=*` check.
    The whitelist for `footway=*` is removed.
    
    Fixes #21235.
    ---
     resources/data/validator/highway.mapcss | 18 +++++++++---------
     1 file changed, 9 insertions(+), 9 deletions(-)
    
    diff --git a/resources/data/validator/highway.mapcss b/resources/data/validator/highway.mapcss
    index ed094678c..9044f9288 100644
    a b way[highway=cycleway][cycleway=lane] {  
    103103  assertNoMatch: "way highway=footway";
    104104}
    105105
    106 /* footway, see #10851, #10976, #15439, #19389 */
     106/* footway, see #10851, #10976, #15439, #19389, #21235 */
    107107way[footway=left][/^footway:/],
    108108way[footway=right][/^footway:/],
    109109way[footway=both][/^footway:/],
     110way[footway=separate][/^footway:/],
    110111way[footway=no][/^footway:/] {
    111112  throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}");
    112113  group: tr("deprecated tagging");
    113114  set not_fixable_footway;
    114115  assertMatch: "way footway=both footway:surface=asphalt";
     116  assertMatch: "way footway=separate footway:surface=asphalt";
    115117}
    116 way[footway=none][/footway:/] {
     118way[footway=none][/^footway:/] {
    117119  throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}");
    118120  group: tr("deprecated tagging");
    119121  set not_fixable_footway;
     122  assertMatch: "way footway=none footway:surface=asphalt";
     123  assertNoMatch: "way footway=no footway:surface=asphalt";
    120124}
     125
    121126way[footway=left]!.not_fixable_footway,
    122127way[footway=right]!.not_fixable_footway,
    123128way[footway=both]!.not_fixable_footway,
     129way[footway=separate]!.not_fixable_footway,
    124130way[footway=no]!.not_fixable_footway {
    125131  throwWarning: tr("{0} is deprecated", "{0.tag}");
    126132  suggestAlternative: "sidewalk";
    way[footway=no]!.not_fixable_footway {  
    128134  fixChangeKey: "footway => sidewalk";
    129135  set fixable_footway;
    130136}
     137
    131138way[footway=none]!.not_fixable_footway {
    132139  throwWarning: tr("{0} is deprecated", "{0.tag}");
    133140  suggestAlternative: "sidewalk=no";
    way[footway=none]!.not_fixable_footway {  
    136143  fixAdd: "sidewalk=no";
    137144  set fixable_footway;
    138145}
    139 way[footway][footway!=access_aisle][footway!=crossing][footway!=sidewalk]!.fixable_footway!.not_fixable_footway { /* do not trigger this rule if already one of the 4 previous rules applied */
    140   throwWarning: tr("Value of {0} should either be {1}, {2} or {3}. For sidewalks use {4} instead.", "{0.key}", "{1.value}", "{2.value}", "{3.value}", "sidewalk=left|right|both|no");
    141   assertNoMatch: "way footway=left";
    142   assertNoMatch: "way footway=none";
    143   assertNoMatch: "way footway=left footway:left:surface=asphalt";
    144   assertMatch: "way footway=bar";
    145 }
    146146
    147147/* #11270, #9297, #15439, #16424, #17022 */
    148148way[railway =~ /^(miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway }