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] {
|
103 | 103 | assertNoMatch: "way highway=footway"; |
104 | 104 | } |
105 | 105 | |
106 | | /* footway, see #10851, #10976, #15439, #19389 */ |
| 106 | /* footway, see #10851, #10976, #15439, #19389, #21235 */ |
107 | 107 | way[footway=left][/^footway:/], |
108 | 108 | way[footway=right][/^footway:/], |
109 | 109 | way[footway=both][/^footway:/], |
| 110 | way[footway=separate][/^footway:/], |
110 | 111 | way[footway=no][/^footway:/] { |
111 | 112 | throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}"); |
112 | 113 | group: tr("deprecated tagging"); |
113 | 114 | set not_fixable_footway; |
114 | 115 | assertMatch: "way footway=both footway:surface=asphalt"; |
| 116 | assertMatch: "way footway=separate footway:surface=asphalt"; |
115 | 117 | } |
116 | | way[footway=none][/footway:/] { |
| 118 | way[footway=none][/^footway:/] { |
117 | 119 | throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}"); |
118 | 120 | group: tr("deprecated tagging"); |
119 | 121 | set not_fixable_footway; |
| 122 | assertMatch: "way footway=none footway:surface=asphalt"; |
| 123 | assertNoMatch: "way footway=no footway:surface=asphalt"; |
120 | 124 | } |
| 125 | |
121 | 126 | way[footway=left]!.not_fixable_footway, |
122 | 127 | way[footway=right]!.not_fixable_footway, |
123 | 128 | way[footway=both]!.not_fixable_footway, |
| 129 | way[footway=separate]!.not_fixable_footway, |
124 | 130 | way[footway=no]!.not_fixable_footway { |
125 | 131 | throwWarning: tr("{0} is deprecated", "{0.tag}"); |
126 | 132 | suggestAlternative: "sidewalk"; |
… |
… |
way[footway=no]!.not_fixable_footway {
|
128 | 134 | fixChangeKey: "footway => sidewalk"; |
129 | 135 | set fixable_footway; |
130 | 136 | } |
| 137 | |
131 | 138 | way[footway=none]!.not_fixable_footway { |
132 | 139 | throwWarning: tr("{0} is deprecated", "{0.tag}"); |
133 | 140 | suggestAlternative: "sidewalk=no"; |
… |
… |
way[footway=none]!.not_fixable_footway {
|
136 | 143 | fixAdd: "sidewalk=no"; |
137 | 144 | set fixable_footway; |
138 | 145 | } |
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 | | } |
146 | 146 | |
147 | 147 | /* #11270, #9297, #15439, #16424, #17022 */ |
148 | 148 | way[railway =~ /^(miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway } |