1 | /* measurement values and units warnings (tickets #8687, #15719) */
|
---|
2 |
|
---|
3 | *[/^[0-9]+$/] {
|
---|
4 | throwWarning: tr("numerical key");
|
---|
5 | assertMatch: "way 123=foo";
|
---|
6 | assertNoMatch: "way ref.1=foo";
|
---|
7 | }
|
---|
8 |
|
---|
9 | *[layer =~ /^\+\d/] {
|
---|
10 | throwWarning: tr("{0} value with + sign", "{0.key}");
|
---|
11 | fixAdd: concat("layer=", replace(tag("layer"), "+", ""));
|
---|
12 | assertMatch: "node layer=+1";
|
---|
13 | assertNoMatch: "node layer=1";
|
---|
14 | assertNoMatch: "node layer=-1";
|
---|
15 | assertNoMatch: "node layer=+foo";
|
---|
16 | }
|
---|
17 |
|
---|
18 | *[layer][layer !~ /^0$|^(-|\+)?[1-5]$/] {
|
---|
19 | throwWarning: tr("{0} should be an integer value between -5 and 5", "{0.key}");
|
---|
20 | assertMatch: "node layer=-50";
|
---|
21 | assertMatch: "node layer=6";
|
---|
22 | assertMatch: "node layer=+10";
|
---|
23 | assertMatch: "node layer=0.5";
|
---|
24 | assertMatch: "node layer=0;1";
|
---|
25 | assertNoMatch: "node layer=-5";
|
---|
26 | assertNoMatch: "node layer=0";
|
---|
27 | assertNoMatch: "node layer=2";
|
---|
28 | assertNoMatch: "node layer=+5"; /* this is an invalid value, but this case is already covered by the previous rule */
|
---|
29 | }
|
---|
30 |
|
---|
31 | *[building:levels][building:levels !~ /^(([0-9]|[1-9][0-9]*)(\.5)?)$/],
|
---|
32 | *[level][level !~ /^((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5)(;((((-*[1-9]|[0-9])|-*[1-9][0-9]*)(\.5)?)|-0\.5))*$/] { /* all numbers from -∞ to ∞ in 0.5 steps, optional multiple values separated by a ; */
|
---|
33 | throwWarning: tr("{0} should have numbers only with optional .5 increments", "{0.key}");
|
---|
34 | assertMatch: "node level=one";
|
---|
35 | assertMatch: "node level=01";
|
---|
36 | assertMatch: "node level=-03";
|
---|
37 | assertMatch: "node level=-01.5";
|
---|
38 | assertMatch: "node level=2.3";
|
---|
39 | assertMatch: "node level=-0";
|
---|
40 | assertNoMatch: "node level=0";
|
---|
41 | assertNoMatch: "node level=1";
|
---|
42 | assertNoMatch: "node level=-1";
|
---|
43 | assertNoMatch: "node level=-0.5";
|
---|
44 | assertNoMatch: "node level=1.5";
|
---|
45 | assertNoMatch: "node level=12";
|
---|
46 | assertNoMatch: "node level=0;1";
|
---|
47 | assertNoMatch: "node level=1;1.5";
|
---|
48 | assertNoMatch: "node level=1;0.5";
|
---|
49 | assertNoMatch: "node level=0;-0.5";
|
---|
50 | assertNoMatch: "node level=-0.5;0";
|
---|
51 | assertNoMatch: "node level=-1;-0.5";
|
---|
52 | assertNoMatch: "node building:levels=1.5";
|
---|
53 | assertMatch: "node building:levels=-1";
|
---|
54 | assertNoMatch: "node building:levels=0"; /* valid because there can be building:levels:underground > 0 or roof:levels > 0 */
|
---|
55 | }
|
---|
56 |
|
---|
57 | *[height][height =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
58 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
59 | fixAdd: concat("height=", replace(tag("height"), ",", "."));
|
---|
60 | set height_separator_autofix;
|
---|
61 | assertMatch: "node height=5,5";
|
---|
62 | assertMatch: "node height=12,00";
|
---|
63 | assertMatch: "node height=12,5 ft";
|
---|
64 | assertNoMatch: "node height=12,000";
|
---|
65 | assertNoMatch: "node height=3,50,5";
|
---|
66 | assertNoMatch: "node height=3.5";
|
---|
67 | assertNoMatch: "node height=4";
|
---|
68 | }
|
---|
69 | *[height][height !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([1-9][0-9]*\'((10|11|[0-9])((\.[0-9]+)?)\")?))$/]!.height_separator_autofix {
|
---|
70 | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
71 | assertMatch: "node height=medium";
|
---|
72 | assertMatch: "node height=-5";
|
---|
73 | assertNoMatch: "node height=2 m";
|
---|
74 | assertNoMatch: "node height=5";
|
---|
75 | assertNoMatch: "node height=7.8";
|
---|
76 | assertNoMatch: "node height=20 ft";
|
---|
77 | assertNoMatch: "node height=22'";
|
---|
78 | }
|
---|
79 |
|
---|
80 | *[maxheight][maxheight =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
81 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
82 | fixAdd: concat("maxheight=", replace(tag("maxheight"), ",", "."));
|
---|
83 | set maxheight_separator_autofix;
|
---|
84 | assertMatch: "node maxheight=5,5";
|
---|
85 | assertMatch: "node maxheight=12,00";
|
---|
86 | assertMatch: "node maxheight=12,5 ft";
|
---|
87 | assertNoMatch: "node maxheight=12,000";
|
---|
88 | assertNoMatch: "node maxheight=3,50,5";
|
---|
89 | assertNoMatch: "node maxheight=3.5";
|
---|
90 | assertNoMatch: "node maxheight=4";
|
---|
91 | }
|
---|
92 | *[maxheight][maxheight !~ /^(([1-9][0-9]*(\.[0-9]+)?( (m|ft))?)|([0-9]+\'(([0-9]|10|11)(\.[0-9]*)?\")?)|none|default|below_default)$/]!.maxheight_separator_autofix {
|
---|
93 | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
94 | assertMatch: "node maxheight=something";
|
---|
95 | assertMatch: "node maxheight=-5";
|
---|
96 | assertMatch: "node maxheight=0";
|
---|
97 | assertNoMatch: "node maxheight=4";
|
---|
98 | assertNoMatch: "node maxheight=3.5";
|
---|
99 | assertNoMatch: "node maxheight=2 m";
|
---|
100 | assertNoMatch: "node maxheight=14 ft";
|
---|
101 | assertNoMatch: "node maxheight=10'";
|
---|
102 | assertNoMatch: "node maxheight=16'3\"";
|
---|
103 | }
|
---|
104 |
|
---|
105 | *[width][width =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
106 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
107 | fixAdd: concat("width=", replace(tag("width"), ",", "."));
|
---|
108 | set width_separator_autofix;
|
---|
109 | assertMatch: "node width=5,5";
|
---|
110 | assertMatch: "node width=12,00";
|
---|
111 | assertNoMatch: "node width=12,000";
|
---|
112 | assertNoMatch: "node width=3,50,5";
|
---|
113 | assertNoMatch: "node width=3.5";
|
---|
114 | assertNoMatch: "node width=4";
|
---|
115 | }
|
---|
116 | *[width][width !~ /^(([0-9]+\.?[0-9]*( [a-z]+)?)|([0-9]+\'([0-9]+\.?[0-9]*\")?))$/]!.width_separator_autofix {
|
---|
117 | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
118 | assertMatch: "way width=something";
|
---|
119 | assertMatch: "way width=-5";
|
---|
120 | assertNoMatch: "way width=3";
|
---|
121 | assertNoMatch: "way width=0.5";
|
---|
122 | assertNoMatch: "way width=1 m";
|
---|
123 | assertNoMatch: "way width=10 ft";
|
---|
124 | assertNoMatch: "way width=1'";
|
---|
125 | assertNoMatch: "way width=10'5\"";
|
---|
126 | }
|
---|
127 |
|
---|
128 | *[maxwidth][maxwidth =~ /^[0-9]+,[0-9][0-9]?( (m|ft))?$/] {
|
---|
129 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
130 | fixAdd: concat("maxwidth=", replace(tag("maxwidth"), ",", "."));
|
---|
131 | set maxwidth_separator_autofix;
|
---|
132 | assertMatch: "node maxwidth=5,5";
|
---|
133 | assertMatch: "node maxwidth=12,00";
|
---|
134 | assertNoMatch: "node maxwidth=12,000";
|
---|
135 | assertNoMatch: "node maxwidth=3,50,5";
|
---|
136 | assertNoMatch: "node maxwidth=3.5";
|
---|
137 | assertNoMatch: "node maxwidth=4";
|
---|
138 | }
|
---|
139 | *[maxwidth][maxwidth !~ /^(([0-9]+\.?[0-9]*( (m|ft))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxwidth_separator_autofix {
|
---|
140 | throwWarning: tr("unusual value of {0}: meters is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
141 | assertMatch: "way maxwidth=something";
|
---|
142 | assertMatch: "way maxwidth=-5";
|
---|
143 | assertNoMatch: "way maxwidth=2";
|
---|
144 | assertNoMatch: "way maxwidth=6'6\"";
|
---|
145 | assertNoMatch: "way maxwidth=2.5";
|
---|
146 | assertNoMatch: "way maxwidth=7 ft";
|
---|
147 | }
|
---|
148 |
|
---|
149 | *[maxweight][maxweight =~ /^[0-9]+,[0-9][0-9]?( (t|kg|lbs))?$/] {
|
---|
150 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
151 | fixAdd: concat("maxweight=", replace(tag("maxweight"), ",", "."));
|
---|
152 | set maxweight_separator_autofix;
|
---|
153 | assertMatch: "node maxweight=5,5";
|
---|
154 | assertMatch: "node maxweight=12,00";
|
---|
155 | assertNoMatch: "node maxweight=12,000";
|
---|
156 | assertNoMatch: "node maxweight=3,50,5";
|
---|
157 | assertNoMatch: "node maxweight=3.5";
|
---|
158 | assertNoMatch: "node maxweight=4";
|
---|
159 | }
|
---|
160 | *[maxweight][maxweight !~ /^(([0-9]+\.?[0-9]*( (t|kg|lbs))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.maxweight_separator_autofix {
|
---|
161 | throwWarning: tr("unusual value of {0}: tonne is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
162 | assertMatch: "way maxweight=something";
|
---|
163 | assertMatch: "way maxweight=-5";
|
---|
164 | assertNoMatch: "way maxweight=2";
|
---|
165 | assertNoMatch: "way maxweight=6'6\"";
|
---|
166 | assertNoMatch: "way maxweight=2.5";
|
---|
167 | assertNoMatch: "way maxweight=7 kg";
|
---|
168 | }
|
---|
169 |
|
---|
170 | way[maxspeed][maxspeed !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
|
---|
171 | way[maxspeed:forward][maxspeed:forward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/],
|
---|
172 | way[maxspeed:backward][maxspeed:backward !~ /^(signals|none|unposted|variable|walk|[1-9][0-9]*( [a-z]+)?|[A-Z][A-Z]:(urban|rural|living_street|motorway))$/] {
|
---|
173 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
174 | assertMatch: "way maxspeed=something";
|
---|
175 | assertMatch: "way maxspeed=-50";
|
---|
176 | assertMatch: "way maxspeed=0";
|
---|
177 | assertNoMatch: "way maxspeed=50";
|
---|
178 | assertNoMatch: "way maxspeed=30 mph";
|
---|
179 | assertNoMatch: "way maxspeed=RO:urban";
|
---|
180 | assertNoMatch: "way maxspeed=RU:rural";
|
---|
181 | assertNoMatch: "way maxspeed=RU:living_street";
|
---|
182 | assertNoMatch: "way maxspeed=DE:motorway";
|
---|
183 | assertNoMatch: "way maxspeed=signals";
|
---|
184 | assertNoMatch: "way maxspeed=none";
|
---|
185 | assertNoMatch: "way maxspeed=variable";
|
---|
186 | }
|
---|
187 |
|
---|
188 | *[distance][distance =~ /^[0-9]+,[0-9][0-9]?( (m|km|mi|nmi))?$/] {
|
---|
189 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
190 | fixAdd: concat("distance=", replace(tag("distance"), ",", "."));
|
---|
191 | set distance_separator_autofix;
|
---|
192 | assertMatch: "node distance=5,5";
|
---|
193 | assertMatch: "node distance=12,00";
|
---|
194 | assertNoMatch: "node distance=12,000";
|
---|
195 | assertNoMatch: "node distance=3,50,5";
|
---|
196 | assertNoMatch: "node distance=3.5";
|
---|
197 | assertNoMatch: "node distance=4";
|
---|
198 | }
|
---|
199 | *[distance][distance !~ /^(([0-9]+\.?[0-9]*( (m|km|mi|nmi))?)|([0-9]+\'[0-9]+\.?[0-9]*\"))$/]!.distance_separator_autofix {
|
---|
200 | throwWarning: tr("unusual value of {0}: kilometers is default; point is decimal separator; if units, put space then unit", "{0.key}");
|
---|
201 | assertMatch: "way distance=something";
|
---|
202 | assertMatch: "way distance=-5";
|
---|
203 | assertNoMatch: "way distance=2";
|
---|
204 | assertNoMatch: "way distance=2.5";
|
---|
205 | assertNoMatch: "way distance=7 mi";
|
---|
206 | }
|
---|
207 |
|
---|
208 | way[voltage][voltage =~ /(.*[A-Za-z].*)|.*,.*|.*( ).*/] {
|
---|
209 | throwWarning: tr("voltage should be in volts with no units/delimiter/spaces");
|
---|
210 | assertMatch: "way voltage=medium";
|
---|
211 | assertNoMatch: "way voltage=15000";
|
---|
212 | }
|
---|
213 |
|
---|
214 | /* some users are using frequency for other purposes (not electromagnetic)
|
---|
215 | with the values 'perennial' and 'intermittent'; the vast majority are 0, 16.7, 50 and 60 */
|
---|
216 | way[frequency][frequency !~ /^(0|[1-9][0-9]*(\.[0-9]+)?)( (kHz|MHz|GHz|THz))?$/] {
|
---|
217 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
218 | assertMatch: "way frequency=something";
|
---|
219 | assertNoMatch: "way frequency=0"; /* DC */
|
---|
220 | assertNoMatch: "way frequency=16.7";
|
---|
221 | assertNoMatch: "way frequency=50";
|
---|
222 | assertNoMatch: "way frequency=680 kHz";
|
---|
223 | assertNoMatch: "way frequency=123.5 MHz";
|
---|
224 | }
|
---|
225 |
|
---|
226 | way[gauge][gauge !~ /^([1-9][0-9]{1,3}(;[1-9][0-9]{1,3})*|broad|standard|narrow)$/] {
|
---|
227 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
228 | assertMatch: "way gauge=something";
|
---|
229 | assertNoMatch: "way gauge=1435";
|
---|
230 | assertNoMatch: "way gauge=1000;1435";
|
---|
231 | assertNoMatch: "way gauge=standard";
|
---|
232 | assertNoMatch: "way gauge=narrow";
|
---|
233 | }
|
---|
234 |
|
---|
235 | /* the numbers for percentage and degrees include could probably be bracketed a bit more precisely */
|
---|
236 | way[incline][incline !~ /^(up|down|-?([0-9]+?(\.[1-9]%)?|100)[%°]?)$/] {
|
---|
237 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
238 | suggestAlternative: "x%";
|
---|
239 | suggestAlternative: "x°";
|
---|
240 | suggestAlternative: "up";
|
---|
241 | suggestAlternative: "down";
|
---|
242 | assertMatch: "way incline=extreme";
|
---|
243 | assertNoMatch: "way incline=up";
|
---|
244 | assertNoMatch: "way incline=down";
|
---|
245 | assertNoMatch: "way incline=10%";
|
---|
246 | assertNoMatch: "way incline=-5%";
|
---|
247 | assertNoMatch: "way incline=10°";
|
---|
248 | }
|
---|
249 |
|
---|
250 | /* see ticket #9631 */
|
---|
251 | *[population][population !~ /^[0-9]+$/ ] {
|
---|
252 | throwWarning: tr("{0} must be a numeric value", "{0.key}");
|
---|
253 | }
|
---|
254 |
|
---|
255 | /* must be an integer positive number only and not 0, see #10837 (lanes), #11055 (screen) */
|
---|
256 | way[lanes][lanes !~ /^[1-9]([0-9]*)$/][highway],
|
---|
257 | way["lanes:backward"]["lanes:backward" !~ /^[1-9]([0-9]*)$/][highway],
|
---|
258 | way["lanes:forward"]["lanes:forward" !~ /^[1-9]([0-9]*)$/][highway],
|
---|
259 | *[screen][screen !~ /^[1-9]([0-9]*)$/][amenity=cinema] {
|
---|
260 | throwError: tr("{0} must be a positive integer number", "{0.key}");
|
---|
261 | assertMatch: "way highway=residential lanes=-1";
|
---|
262 | assertMatch: "way highway=residential lanes=5.5";
|
---|
263 | assertMatch: "way highway=residential lanes=1;2";
|
---|
264 | assertMatch: "way highway=residential lanes:forward=-1";
|
---|
265 | assertMatch: "way highway=residential lanes:backward=-1";
|
---|
266 | assertNoMatch: "way highway=residential lanes=1";
|
---|
267 | assertMatch: "node amenity=cinema screen=led";
|
---|
268 | assertNoMatch: "node amenity=cinema screen=8";
|
---|
269 | }
|
---|
270 | *[admin_level][admin_level !~ /^(1|2|3|4|5|6|7|8|9|10|11|12)$/] {
|
---|
271 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
272 | assertMatch: "node admin_level=0";
|
---|
273 | assertMatch: "node admin_level=-1";
|
---|
274 | assertMatch: "node admin_level=13";
|
---|
275 | assertNoMatch: "node admin_level=5";
|
---|
276 | }
|
---|
277 |
|
---|
278 | /* #14989 */
|
---|
279 | *[direction][direction<0],
|
---|
280 | *[direction][direction>=360],
|
---|
281 | *[direction][direction !~ /^([0-9][0-9]?[0-9]?|north|east|south|west|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW|forward|backward|both|clockwise|anti-clockwise|anticlockwise|up|down)((-|;)([0-9][0-9]?[0-9]?|N|E|S|W|NE|SE|SW|NW|NNE|ENE|ESE|SSE|SSW|WSW|WNW|NNW))*$/] {
|
---|
282 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
283 | assertMatch: "node direction=north-down";
|
---|
284 | assertMatch: "node direction=rome";
|
---|
285 | assertMatch: "node direction=C";
|
---|
286 | assertMatch: "node direction=NNNE";
|
---|
287 | assertMatch: "node direction=1360";
|
---|
288 | assertNoMatch: "node direction=NE-S"; /* ranges are used at tourism=viewpoint*/
|
---|
289 | assertMatch: "node direction=north-south"; /* ranges only in numbers or short NESW form */
|
---|
290 | assertMatch: "node direction=north-east"; /* if range use N-E, if single direcion use NE */
|
---|
291 | assertNoMatch: "node direction=0-360"; /* complete panorama view */
|
---|
292 | assertNoMatch: "node direction=45-100;190-250;300-360";
|
---|
293 | assertMatch: "node direction=45-100;190-250;300-";
|
---|
294 | assertNoMatch: "node direction=45-100;190-250;300";
|
---|
295 | assertNoMatch: "node direction=90;270";
|
---|
296 | assertNoMatch: "node direction=up";
|
---|
297 | assertNoMatch: "node direction=down"; /* up/down are replaced by incline tag, has separate warning */
|
---|
298 | assertMatch: "node direction=-10";
|
---|
299 | assertNoMatch: "node direction=0";
|
---|
300 | assertNoMatch: "node direction=45";
|
---|
301 | assertMatch: "node direction=360";
|
---|
302 | assertNoMatch: "node direction=N";
|
---|
303 | assertNoMatch: "node direction=NNE";
|
---|
304 | assertNoMatch: "node direction=west";
|
---|
305 | assertNoMatch: "node direction=forward";
|
---|
306 | assertNoMatch: "node direction=anti-clockwise";
|
---|
307 | assertNoMatch: "node direction=anticlockwise"; /* both spellings are in use and even wiki uses both */
|
---|
308 | }
|
---|
309 |
|
---|
310 | /* #14786 (should be safe to just remove the meters unit from the value) */
|
---|
311 | *[ele][ele =~ /^-?[0-9]+(\.[0-9]+)? ?m$/] {
|
---|
312 | throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}");
|
---|
313 | fixAdd: concat("ele=", trim(replace(tag("ele"), "m", "")));
|
---|
314 | set ele_meter_remove_autofix;
|
---|
315 | assertMatch: "node ele=12m";
|
---|
316 | assertMatch: "node ele=12 m";
|
---|
317 | assertNoMatch: "node ele=12km";
|
---|
318 | assertMatch: "node ele=12.1m";
|
---|
319 | assertMatch: "node ele=-12.1 m";
|
---|
320 | assertNoMatch: "node ele=12";
|
---|
321 | assertNoMatch: "node ele=high";
|
---|
322 | }
|
---|
323 | *[ele][ele =~ /^[0-9]+,[0-9][0-9]?$/] {
|
---|
324 | throwWarning: tr("unusual value of {0}: use . instead of , as decimal separator", "{0.key}");
|
---|
325 | fixAdd: concat("ele=", replace(tag("ele"), ",", "."));
|
---|
326 | set ele_separator_autofix;
|
---|
327 | assertMatch: "node ele=5,5";
|
---|
328 | assertMatch: "node ele=12,00";
|
---|
329 | assertNoMatch: "node ele=8,848"; /* wrongly used thousands separator */
|
---|
330 | assertNoMatch: "node ele=3,50,5";
|
---|
331 | assertNoMatch: "node ele=3.5";
|
---|
332 | assertNoMatch: "node ele=4";
|
---|
333 | }
|
---|
334 | *[ele][ele !~ /^-?[0-9]+(\.[0-9]+)?$/]!.ele_meter_remove_autofix!.ele_separator_autofix {
|
---|
335 | throwWarning: tr("{0} must be a numeric value, in meters and without units", "{0.key}");
|
---|
336 | assertNoMatch: "node ele=12m";
|
---|
337 | assertNoMatch: "node ele=12 m";
|
---|
338 | assertMatch: "node ele=12km";
|
---|
339 | assertNoMatch: "node ele=12.1m";
|
---|
340 | assertNoMatch: "node ele=-12.1 m";
|
---|
341 | assertNoMatch: "node ele=12";
|
---|
342 | assertMatch: "node ele=high";
|
---|
343 | }
|
---|
344 |
|
---|
345 | /* #17530 */
|
---|
346 | *[ele][ele =~ /^-?[0-9]+\.[0-9][0-9][0-9]+$/] {
|
---|
347 | throwWarning: tr("{0}", "{0.tag}");
|
---|
348 | group: tr("Unnecessary amount of decimal places");
|
---|
349 | fixAdd: concat("ele=", round(tag("ele")*100)/100);
|
---|
350 | assertNoMatch: "node ele=12";
|
---|
351 | assertNoMatch: "node ele=1.12";
|
---|
352 | assertMatch: "node ele=12.123";
|
---|
353 | assertMatch: "node ele=12.1234";
|
---|
354 | assertMatch: "node ele=-12.6789";
|
---|
355 | assertNoMatch: "node ele=12.123 m";
|
---|
356 | assertNoMatch: "node ele=high";
|
---|
357 | }
|
---|
358 |
|
---|
359 | /* #15774 */
|
---|
360 | node[fire_hydrant:pressure="#"] {
|
---|
361 | throwError: tr("unusual value of {0}", "{0.key}");
|
---|
362 | }
|
---|
363 |
|
---|
364 | *[interval][interval !~ /^([0-9][0-9]?|[0-9][0-9]:[0-5][0-9](:[0-9][0-9])?)$/] {
|
---|
365 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
366 | assertNoMatch: "way interval=5";
|
---|
367 | assertNoMatch: "way interval=20";
|
---|
368 | assertNoMatch: "way interval=00:05";
|
---|
369 | assertNoMatch: "way interval=00:05:00";
|
---|
370 | assertNoMatch: "way interval=03:00:00";
|
---|
371 | assertMatch: "way interval=123";
|
---|
372 | assertMatch: "way interval=0:5:0";
|
---|
373 | assertMatch: "way interval=00:65:00";
|
---|
374 | }
|
---|
375 |
|
---|
376 | /* #15107 */
|
---|
377 | *[aeroway=helipad ][iata][iata!~/^[A-Z]{3}$/],
|
---|
378 | *[aeroway=aerodrome][iata][iata!~/^[A-Z]{3}$/] {
|
---|
379 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
380 | group: tr("Airport tagging");
|
---|
381 | assertNoMatch: "way aeroway=aerodrome iata=BER";
|
---|
382 | assertMatch: "way aeroway=aerodrome iata=BERL";
|
---|
383 | assertMatch: "way aeroway=aerodrome iata=BE";
|
---|
384 | assertMatch: "way aeroway=aerodrome iata=ber";
|
---|
385 | }
|
---|
386 | *[aeroway=helipad ][icao][icao!~/^[A-Z]{4}$/],
|
---|
387 | *[aeroway=aerodrome][icao][icao!~/^[A-Z]{4}$/] {
|
---|
388 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
389 | group: tr("Airport tagging");
|
---|
390 | assertNoMatch: "way aeroway=aerodrome icao=EDDB";
|
---|
391 | assertMatch: "way aeroway=aerodrome icao=EDDBA";
|
---|
392 | assertMatch: "way aeroway=aerodrome icao=EDD";
|
---|
393 | assertMatch: "way aeroway=aerodrome icao=eddb";
|
---|
394 | }
|
---|
395 | *[aeroway=helipad ][icao][icao!~/^(AG|AN|AY|BG|BI|BK|C|DA|DB|DF|DG|DI|DN|DR|DT|DX|EB|ED|EE|EF|EG|EH|EI|EK|EL|EN|EP|ES|ET|EV|EY|FA|FB|FC|FD|FE|FG|FH|FI|FJ|FK|FL|FM|FN|FO|FP|FQ|FS|FT|FV|FW|FX|FY|FZ|GA|GB|GC|GE|GF|GG|GL|GM|GO|GQ|GS|GU|GV|HA|HB|HC|HD|HE|HH|HK|HL|HR|HS|HT|HU|K|LA|LB|LC|LD|LE|LF|LG|LH|LI|LJ|LK|LL|LM|LN|LO|LP|LQ|LR|LS|LT|LU|LV|LW|LX|LY|LZ|MB|MD|MG|MH|MK|MM|MN|MP|MR|MS|MT|MU|MW|MY|MZ|NC|NF|NG|NI|NL|NS|NT|NV|NW|NZ|OA|OB|OE|OI|OJ|OK|OL|OM|OO|OP|OR|OS|OT|OY|PA|PB|PC|PF|PG|PH|PJ|PK|PL|PM|PO|PP|PT|PW|RC|RJ|RK|RO|RP|SA|SB|SC|SD|SE|SF|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SP|SS|SU|SV|SW|SY|TA|TB|TD|TF|TG|TI|TJ|TK|TL|TN|TQ|TR|TT|TU|TV|TX|U|UA|UB|UC|UD|UG|UK|UM|UT|VA|VC|VD|VE|VG|VH|VI|VL|VM|VN|VO|VQ|VR|VT|VV|VY|WA|WB|WI|WM|WP|WQ|WR|WS|Y|Z|ZK|ZM)/],
|
---|
396 | *[aeroway=aerodrome][icao][icao!~/^(AG|AN|AY|BG|BI|BK|C|DA|DB|DF|DG|DI|DN|DR|DT|DX|EB|ED|EE|EF|EG|EH|EI|EK|EL|EN|EP|ES|ET|EV|EY|FA|FB|FC|FD|FE|FG|FH|FI|FJ|FK|FL|FM|FN|FO|FP|FQ|FS|FT|FV|FW|FX|FY|FZ|GA|GB|GC|GE|GF|GG|GL|GM|GO|GQ|GS|GU|GV|HA|HB|HC|HD|HE|HH|HK|HL|HR|HS|HT|HU|K|LA|LB|LC|LD|LE|LF|LG|LH|LI|LJ|LK|LL|LM|LN|LO|LP|LQ|LR|LS|LT|LU|LV|LW|LX|LY|LZ|MB|MD|MG|MH|MK|MM|MN|MP|MR|MS|MT|MU|MW|MY|MZ|NC|NF|NG|NI|NL|NS|NT|NV|NW|NZ|OA|OB|OE|OI|OJ|OK|OL|OM|OO|OP|OR|OS|OT|OY|PA|PB|PC|PF|PG|PH|PJ|PK|PL|PM|PO|PP|PT|PW|RC|RJ|RK|RO|RP|SA|SB|SC|SD|SE|SF|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SP|SS|SU|SV|SW|SY|TA|TB|TD|TF|TG|TI|TJ|TK|TL|TN|TQ|TR|TT|TU|TV|TX|U|UA|UB|UC|UD|UG|UK|UM|UT|VA|VC|VD|VE|VG|VH|VI|VL|VM|VN|VO|VQ|VR|VT|VV|VY|WA|WB|WI|WM|WP|WQ|WR|WS|Y|Z|ZK|ZM)/] {
|
---|
397 | throwWarning: tr("wrong value: {0}", "{1.tag}");
|
---|
398 | group: tr("Airport tagging");
|
---|
399 | assertNoMatch: "way aeroway=aerodrome icao=EDDB";
|
---|
400 | assertMatch: "way aeroway=aerodrome icao=EQQQ";
|
---|
401 | }
|
---|
402 |
|
---|
403 | /* #18573 */
|
---|
404 | *[isced:level][isced:level !~ /^(0|1|2|3|4|5|6|7|8)((;|-)(1|2|3|4|5|6|7|8))*$/] {
|
---|
405 | throwWarning: tr("unusual value of {0}", "{0.key}");
|
---|
406 | assertMatch: "node isced:level=secondary";
|
---|
407 | assertMatch: "node isced:level=0,1,2,3";
|
---|
408 | assertMatch: "node isced:level=9";
|
---|
409 | assertMatch: "node isced:level=10";
|
---|
410 | assertNoMatch: "node isced:level=0;1;2;3";
|
---|
411 | assertNoMatch: "node isced:level=0";
|
---|
412 | assertNoMatch: "node isced:level=5";
|
---|
413 | assertNoMatch: "node isced:level=0-3";
|
---|
414 | }
|
---|