source: josm/trunk/resources/data/validator/combinations.mapcss@ 18385

Last change on this file since 18385 was 18370, checked in by stoecker, 4 years ago

fix #21736, patch by skyper, False positive: "oneway=yes together with lanes:backward/forward" together with oneway:*

  • Property svn:eol-style set to native
File size: 51.3 KB
Line 
1/* Rules partially derived from Taginfo statistics - see ticket #5017
2 * Taginfo query: select keypairs.key1, keypairs.key2, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key1='waterway' and keys.key=keypairs.key2 and (key1<>'highway' or keypairs.count_all>12000) and (key1<>'railway' or keypairs.count_all>3000) and (key1<>'waterway' or keypairs.count_all>800) and key2 not like '%:%' and from_fraction_all>0.97 and 1 union select keypairs.key2, keypairs.key1, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key2='waterway' and keys.key=keypairs.key1 and (key2<>'highway' or keypairs.count_all>12000) and (key2<>'railway' or keypairs.count_all>3000) and (key2<>'waterway' or keypairs.count_all>800) and key1 not like '%:%' and from_fraction_all>0.97 and 1 order by keypairs.count_all desc limit 1000;
3 */
4
5way[surface=~/^(unpaved|compacted|gravel|fine_gravel|pebblestone|ground|earth|dirt|grass|sand|mud|ice|salt|snow|woodchips)$/] { /* without grass_paver as it is controversial */
6 set unpaved_surface;
7}
8
9/* {0.key} without {1.key} (warning level) */
10way[junction ][!highway][junction!=yes][!area:highway],
11way[living_street ][!highway],
12way[maintenance ][!highway],
13way[median ][!highway],
14way[motorroad ][!highway],
15node[ntd_id ][!highway],
16way[sac_scale ][!highway],
17way[sidewalk ][!highway],
18way[step_count ][!highway][man_made!=tower],
19way[tracktype ][!highway],
20way[trail_visibility ][!highway], /* #15029 */
21way[trolley_wire ][!highway],
22way[zip_left ][!highway],
23way[zip_right ][!highway],
24way[detail ][!railway][route!=railway],
25way[eddy_current_brake ][!railway][route!=railway],
26way[electrified ][!railway][route!=railway][!highway], /* #16007 */
27way[etcs ][!railway][route!=railway],
28way[gauge ][!railway][route!=railway],
29way[grade_of_track ][!railway][route!=railway],
30way[kursbuchstrecke ][!railway][route!=railway],
31way[lzb ][!railway][route!=railway],
32way[old_railway_operator ][!railway][route!=railway],
33way[operating_procedure ][!railway][route!=railway],
34way[pzb ][!railway][route!=railway],
35way[structure_gauge ][!railway][route!=railway],
36way[tilting_technology ][!railway][route!=railway],
37way[track_class ][!railway][route!=railway],
38way[tracks ][!railway][route!=railway],
39way[traffic_mode ][!railway][route!=railway],
40way[workrules ][!railway][route!=railway],
41way[length_unit ][!waterway],
42way[canal ][!waterway],
43way[have_riverbank ][!waterway],
44*[border_type ][!boundary],
45*[piste:difficulty ][!piste:type],
46*[place ][!name][place!=islet][place!=plot][noname!=yes],
47*[transformer ][!power],
48*[source:date ][!source],
49*[source:name ][!name][noname!=yes],
50*[source:maxspeed:forward ][!maxspeed:forward][!maxspeed],
51*[source:maxspeed:backward ][!maxspeed:backward][!maxspeed],
52*[source:building ][!building],
53*[source:ref ][!ref][noref!=yes],
54*[source:population ][!population],
55*[source:postal_code ][!postal_code],
56*[source:ele ][!ele],
57*[source:ref:INSEE ][!ref:INSEE],
58*[source:lit ][!lit],
59*[source:hgv ][!hgv],
60*[source:highway ][!highway],
61*[source:maxaxleload ][!maxaxleload],
62*[source:surface ][!surface],
63*[source:bridge ][!bridge],
64*[source:old_name ][!old_name],
65*[source:bicycle ][!bicycle],
66*[source:designation ][!designation],
67*[source:height ][!height],
68*[source:lanes ][!lanes],
69*[source:postcode ][!addr:postcode],
70*[source:housenumber ][!addr:housenumber],
71*[source:addr:postcode ][!addr:postcode],
72*[source:addr:housenumber ][!addr:housenumber] {
73 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
74 group: tr("missing tag");
75 assertMatch: "node source:addr:postcode=postman";
76}
77
78/* {0.key} without {1.key} (info level), #21736 */
79way[lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1],
80way[lanes:backward][!lanes:forward][oneway!=yes][oneway!=-1],
81way[lanes:forward][!lanes:backward][oneway=~/^(yes|-1)$/][/^oneway:(psv|bus)$/=~/^no$/],
82way[lanes:backward][!lanes:forward][oneway=~/^(yes|-1)$/][/^oneway:(psv|bus)$/=~/^no$/],
83*[leaf_type ][!leaf_cycle],
84*[leaf_cycle][!leaf_type] {
85 throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
86 group: tr("missing tag");
87}
88
89/* {0.key} without {1.tag}, #17997 */
90node[railway:switch ][railway!=switch],
91*[generator:source ][power!=generator],
92*[generator:method ][power!=generator],
93*[generator:type ][power!=generator],
94node[fire_hydrant:type ][emergency!=fire_hydrant][disused:emergency!=fire_hydrant],
95node[manhole ][man_made!=manhole],
96way[fence_type ][barrier!=fence],
97*[recycling_type ][amenity!=recycling],
98*[information ][tourism!=information],
99node[board_type ][information!=board],
100*[shelter_type ][amenity!=shelter],
101node[lamp_type ][highway!=street_lamp],
102node[map_type ][information!=map],
103*[site_type ][historic!=archaeological_site],
104*[artwork_type ][tourism!=artwork][exhibit!=artwork],
105*[castle_type ][historic!=castle],
106*[parking ][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/][parking!=yes][parking!=no],
107way[cutline ][man_made!=cutline],
108*[zoo ][tourism!=zoo],
109*[bunker_type ][military!=bunker] {
110 throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
111 group: tr("missing tag");
112}
113
114/* #20742 - No warning about barrier with inappropriate access tags on highway */
115way[highway=~/^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link)$/][!access][!vehicle] > node[barrier][barrier!~/entrance|border_control|height_restrictor|toll_booth/][!access][!motor_vehicle][!vehicle] {
116 throwWarning: tr("{0} without access tags such as {1}, {2}, or {3}.", "{0.tag}", "{2.key}", "{3.key}", "{4.key}");
117 group: tr("suspicious barrier");
118}
119
120way[highway=~/^(footway|path|bridleway|cycleway|service)$/] > node[barrier]:connection {
121 set barrierSmallRoadConnection;
122}
123
124way[highway=~/^(unclassified|residential)$/] >[index = 1] node.barrierSmallRoadConnection,
125way[highway=~/^(unclassified|residential)$/] >[index = -1] node.barrierSmallRoadConnection {
126 set barrierAllowedAtConnection;
127}
128
129/* 20742; warnings for major roads set by other rule, also issue 20742 */
130way[highway=~/^(unclassified|residential)$/] > node[barrier][barrier!=bollard][!access][!access:conditional][!vehicle][!vehicle:conditional][!motor_vehicle][!motor_vehicle:conditional].barrierSmallRoadConnection!.barrierAllowedAtConnection {
131 throwWarning: tr("Suspicious {0} on a connection of a small highway with a larger highway", "{0.tag}");
132 set hasWarningForBarrierOnWay;
133 group: tr("suspicious barrier");
134}
135
136way[highway=~/^(unclassified|residential)$/] > node[barrier].barrierSmallRoadConnection!.hasWarningForBarrierOnWay {
137 throwOther: tr("Suspicious {0} on a connection of a small highway with a larger highway", "{0.tag}");
138 group: tr("suspicious barrier");
139}
140
141/* {0.key} without {1.tag} or {2.tag} */
142*[bridge:movable ][bridge!=movable][man_made!=bridge],
143*[substation ][power!=substation][pipeline!=substation],
144*[reservoir_type ][landuse!=reservoir][water!=reservoir],
145way[waterway=pressurised ][tunnel!=flooded][man_made!=pipeline] {
146 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.tag}", "{2.tag}");
147 group: tr("missing tag");
148}
149
150/* {0.key} without {1.tag}, {2.tag} or {3.tag}, #15107, #20241 */
151*[iata ][aeroway!=aerodrome][aeroway!=heliport][aeroway!=helipad],
152*[icao ][aeroway!=aerodrome][aeroway!=heliport][aeroway!=helipad] {
153 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.tag}", "{2.tag}", "{3.tag}");
154 group: tr("missing tag");
155}
156
157/* {0.key} without {1.tag}, {2.tag}, {3.tag} or {4.tag}, #20530 */
158*[pump_mechanism][man_made!=pump][man_made!=windpump][man_made!=water_well][man_made!=petroleum_well] {
159 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.tag}", "{2.tag}", "{3.tag}", "{4.tag}");
160 group: tr("missing tag");
161}
162
163/* {0.tag} without {1.key} (warning level), #18411, #18246, #20530 */
164way[railway=construction][!construction],
165way[highway=construction][!construction],
166node[traffic_sign=maxspeed][!maxspeed][!/^maxspeed:.+/],
167*[actuator=manual][!handle],
168*[mechanical_driver=manual][!handle],
169node[emergency=fire_hydrant][!fire_hydrant:type],
170way[ boundary=administrative][!admin_level],
171relation[boundary=administrative][!admin_level],
172relation[route=bicycle ][!network][type=route],
173relation[route=hiking ][!network][type=route],
174relation[route=foot ][!network][type=route],
175relation[route=horse ][!network][type=route],
176relation[route=piste][!piste:type][type=route],
177relation[route=ski ][!piste:type][type=route],
178*[tourism=information][!information],
179*[leisure=pitch][!sport],
180*[aeroway=terminal][!building],
181*[office=government][!government],
182*[power=generator][!generator:source],
183*[amenity=social_facility][!social_facility],
184*[amenity=place_of_worship][!religion],
185*[man_made=tower][!tower:type] {
186 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
187 group: tr("missing tag");
188 assertNoMatch: "node traffic_sign=maxspeed maxspeed:hgv:conditional=\"80 @ (weight>7.5 AND 22:00-05:00)\"";
189}
190
191/* {0.tag} without {1.key} (info level), #15107 */
192*[aeroway=runway ][!ref],
193*[aeroway=runway ][!surface],
194node[highway=crossing ][!crossing],
195way[highway=track ][!tracktype],
196way[power=cable ][!location],
197node[power=transformer ][!voltage:primary],
198node[power=transformer ][!voltage:secondary],
199node[transformer=distribution ][!voltage:primary][power=pole],
200node[transformer=distribution ][!voltage:secondary][power=pole],
201way[power=line ][!voltage],
202way[power=minor_line ][!voltage],
203way[power=cable ][!voltage],
204*[power=generator ][!voltage][generator:output:electricity],
205*[power=plant ][!voltage][plant:output:electricity],
206*[power=substation ][!substation],
207*[power=switch ][!switch],
208*[power=transformer ][!transformer],
209*[amenity=bank ][!operator],
210*[amenity=cinema ][!operator],
211*[amenity=fast_food ][!operator],
212*[amenity=fuel ][!operator],
213*[mountain_pass=yes ][!ele],
214*[natural=peak ][!ele],
215*[natural=water ][!water],
216*[amenity=place_of_worship ][!denomination],
217*[amenity=parking ][!parking],
218*[amenity=parking_entrance ][!parking] {
219 throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
220 group: tr("missing tag");
221 assertMatch: "way power=line";
222 assertNoMatch: "way power=line voltage=1";
223 assertMatch: "way power=switch";
224 assertMatch: "way power=substation";
225 assertMatch: "way power=substation transformer=foobar";
226 assertNoMatch: "way power=substation substation=foobar";
227 assertMatch: "way power=generator generator:output:electricity=yes";
228 assertNoMatch: "way power=generator";
229 assertNoMatch: "way power=generator generator:output:electricity=yes voltage=1";
230}
231
232/* {0.key} without {1.key} or {2.tag} */
233way[bridge:structure ][!bridge][man_made!=bridge],
234*[segregated ][!highway][railway!=crossing] {
235 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
236 group: tr("missing tag");
237}
238
239/* {0.tag} without {1.tag} (info level) see #11600 #11393 #11850 */
240way[highway=motorway][!oneway][junction!=roundabout],
241way[highway=motorway_link][!oneway][junction!=roundabout] {
242 throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
243 group: tr("missing tag");
244}
245
246/* {0.tag} without {1.tag} */
247way[usage=penstock][man_made!=pipeline],
248way[usage=penstock][waterway!=pressurised] {
249 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
250 group: tr("missing tag");
251}
252
253/* {0.tag} without {1.tag} or {2.tag} */
254*[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
255 throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
256 group: tr("missing tag");
257}
258
259/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.key} */
260*[smoothness][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/][barrier!=kerb][!kerb] {
261 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.key}");
262 group: tr("missing tag");
263}
264
265/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.tag} */
266*[intermittent ][!waterway][natural!~/^(water|spring)$/][landuse!~/^(basin|reservoir)$/][ford!~/^(yes|stepping_stones)$/],
267*[boat ][!waterway][natural!=water ][landuse!~/^(basin|reservoir)$/][ford!=yes] {
268 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
269 group: tr("missing tag");
270}
271
272/* {0.key} without {1.key}, {2.key} or {3.key} */
273*[snowplowing][!highway][!amenity][!leisure] {
274 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
275 group: tr("missing tag");
276}
277
278/* {0.key} without {1.key}, {2.key} or {3.tag} */
279*[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
280 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
281 group: tr("missing tag");
282}
283
284/* {0.tag} together with {1.key}, see #17664, #17707, #16464, #10837, #14034, #9389, #11977, #13156, #16888, #20530, #21736 */
285*[power=plant][/^generator:/],
286*[power=generator][/^plant:/],
287*[power=plant][voltage],
288*[power=plant][frequency],
289*[internet_access=no][internet_access:fee],
290node[power=transformer][voltage],
291node[transformer=distribution][voltage][power=pole],
292*[amenity=vending_machine][shop],
293*[noname?][name],
294*[actuator][handle][actuator !~ /(^|;)manual(;|$)/],
295*[mechanical_driver][handle][mechanical_driver !~ /(^|;)manual(;|$)/],
296way[oneway=yes][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
297way[oneway=yes][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
298way[oneway=-1 ][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
299way[oneway=-1 ][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/] {
300 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
301 group: tr("suspicious tag combination");
302 assertMatch: "way power=plant generator:source=wind";
303 assertMatch: "way power=generator plant:source=combustion";
304}
305
306/* {0.tag} together with {1.tag} (info level), see #9696 */
307way[highway=footway][oneway=no] {
308 throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
309 group: tr("suspicious tag combination");
310}
311
312/* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186, #18815 */
313*[barrier=kerb][kerb=no],
314way[highway=construction][construction=yes],
315way[railway=construction][construction=yes],
316*[man_made=bridge][bridge=yes],
317*[man_made=tunnel][tunnel=yes],
318*[amenity=police][police],
319node[highway=crossing][crossing=no],
320node[railway=crossing][crossing=no],
321way[junction=yes][highway],
322way[tracktype=grade1][surface].unpaved_surface,
323way[tracktype=grade2][surface][surface=~/^(sand|mud)$/],
324way[segregated][bicycle=no],
325way[segregated][foot=no],
326way[man_made=pipeline][tunnel=flooded] {
327 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
328 group: tr("suspicious tag combination");
329}
330
331/* {0.tag} together with {1.tag} (error level) */
332relation[type=multipolygon][area=no] {
333 throwError: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
334 group: tr("suspicious tag combination");
335}
336
337/* {0.key} together with {1.key}, #18267, #17630, #17604 */
338node[marker][cover],
339node[marker][voltage],
340node[marker][pressure],
341node[marker][diameter],
342node[marker][substance],
343*[building:part][building],
344*[addr:street][addr:place][outside("CZ,DK")] {
345 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
346 group: tr("suspicious tag combination");
347}
348
349/* {0.tag} together with {1.tag} and {2.key}, #18471 */
350way[highway=~/^(cycleway|footway|path)$/][segregated=no][sidewalk =~/^(left|right|both)$/] {
351 throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.tag}", "{2.key}");
352 group: tr("suspicious tag combination");
353}
354
355/* {0.key} together with {1.tag} and {2.key}, #19747 */
356way[railway][electrified=no][frequency],
357way[railway][electrified=no][voltage] {
358 throwWarning: tr("{0} together with {1} and {2}", "{0.key}", "{1.tag}", "{2.key}");
359 group: tr("suspicious tag combination");
360}
361
362/* #11127, #13727 */
363way[waterway][bridge=yes][waterway!=weir] {
364 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
365 suggestAlternative: "bridge=aqueduct";
366 group: tr("suspicious tag combination");
367 fixAdd: "bridge=aqueduct";
368}
369way[waterway=weir][bridge=yes][highway] {
370 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
371 suggestAlternative: "waterway=weir + ford=yes";
372 suggestAlternative: "waterway=dam";
373 suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
374 group: tr("suspicious tag combination");
375}
376
377/* #16214 */
378relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
379 throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
380 fixRemove: "area";
381 set area_yes_autofix;
382 group: tr("suspicious tag combination");
383}
384
385/* only {0.key}, #11104, #12422, #14950, #19572, #20902 */
386/* relations excluded as there is a test for missing type=* plus several other test depending on the type exist */
387node[access][eval(number_of_tags()) = 1],
388way[access][eval(number_of_tags()) = 1],
389node[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
390way[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
391node[lanes][eval(number_of_tags()) = 1],
392way[lanes][eval(number_of_tags()) = 1],
393node[layer][eval(number_of_tags()) = 1],
394way[layer][eval(number_of_tags()) = 1],
395way[level][eval(number_of_tags()) = 1], /* nodes might be valid, e.g. start and end nodes of steps */
396node[lit][eval(number_of_tags()) = 1],
397way[lit][eval(number_of_tags()) = 1],
398node[name][eval(number_of_tags()) = 1],
399way[name][eval(number_of_tags()) = 1],
400node[ref][eval(number_of_tags()) = 1],
401way[ref][eval(number_of_tags()) = 1],
402node[surface][eval(number_of_tags()) = 1],
403way[surface][eval(number_of_tags()) = 1] {
404 throwWarning: tr("incomplete object: only {0}", "{0.key}");
405 set only_one_tag;
406 group: tr("missing tag");
407}
408/* only {0.key} and {1.key} */
409node[name][area][eval(number_of_tags()) = 2],
410way[name][area][eval(number_of_tags()) = 2],
411node[name][ref][eval(number_of_tags()) = 2],
412way[name][ref][eval(number_of_tags()) = 2] {
413 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
414 group: tr("missing tag");
415}
416/* only {0.tag}, #15269 */
417node[tourism=attraction][eval(number_of_tags()) = 1],
418way[tourism=attraction][eval(number_of_tags()) = 1] {
419 throwWarning: tr("incomplete object: only {0}", "{0.tag}");
420 group: tr("missing tag");
421}
422/* only {0.key} and {1.tag} */
423node[name][tourism=attraction][eval(number_of_tags()) = 2],
424way[name][tourism=attraction][eval(number_of_tags()) = 2] {
425 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
426 group: tr("missing tag");
427}
428
429/* #9811, #11491, #12865, #14310 */
430*[place][place!=farm][place!=plot][/^(addr:housenumber|addr:housename|addr:flats|addr:conscriptionnumber|addr:street|addr:place|addr:city|addr:country|addr:full|addr:hamlet|addr:suburb|addr:subdistrict|addr:district|addr:province|addr:state|addr:interpolation|addr:interpolation|addr:inclusion)$/],
431/* addr:postcode is used together with place in some countries */
432*[boundary][/^addr:/],
433*[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
434 throwWarning: tr("{0} together with {1}", "{0.key}", "addr:*");
435 group: tr("suspicious tag combination");
436 assertMatch: "node place=foo addr:housenumber=5";
437 assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
438 assertNoMatch: "node place=foo addr:postcode=12345";
439}
440*[!highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
441 throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
442 group: tr("suspicious tag combination");
443}
444*[!highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
445 throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
446 group: tr("suspicious tag combination");
447}
448way[highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
449 throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
450 group: tr("suspicious tag combination");
451 fixRemove: "addr:postcode";
452}
453way[highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
454 throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
455 group: tr("suspicious tag combination");
456}
457way[highway][highway!=services][highway!=rest_area][!postal_code]["addr:postcode"] {
458 throwWarning: tr("{0} together with {1}", "{0.key}", "{4.key}");
459 suggestAlternative: "postal_code";
460 group: tr("suspicious tag combination");
461 fixChangeKey: "addr:postcode=>postal_code";
462}
463
464/* #9195 */
465way[highway=footway][cycleway=lane] {
466 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
467 suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
468 group: tr("suspicious tag combination");
469}
470
471/* {0} on suspicious object, #17255, #19650, #19572, #17253, #19821, #15667, #19930, #20435, #20471, #18815 */
472way[oneway ][!highway][!area:highway][!railway][!aerialway][attraction!=summer_toboggan][aeroway!~/^(runway|taxiway)$/][leisure!=track][waterway !~ /^(canal|fairway|lock|river|tidal_channel)$/],
473node[lanes ][!barrier][!ford][highway!=mini_roundabout][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
474way[lanes ][!barrier][!ford][!highway ][!area:highway][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
475*[tunnel ][!highway][!area:highway][!railway][!waterway][!piste:type][type!=tunnel][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=tunnel][power!=cable],
476*[bridge ][!highway][!area:highway][!railway][!waterway][!piste:type][type!=bridge][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge],
477*[psv ][!highway][!area:highway][!railway][!waterway][barrier!=bollard][amenity !~ /^parking.*/],
478*[width ][!highway][!area:highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track],
479*[maxspeed ][!highway][!area:highway][!railway][traffic_sign !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][traffic_sign:forward !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][traffic_sign:backward !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type != enforcement][waterway !~ /^(canal|fairway|lock|river|tidal_channel)$/][!traffic_calming][aerialway!=zip_line],
480way[incline][!highway][!area:highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan][leisure!=slipway] {
481 throwWarning: tr("{0} on suspicious object", "{0.key}");
482 group: tr("suspicious tag combination");
483}
484
485/* #15667, #19930 */
486way[waterway][oneway][waterway =~ /^(canal|fairway|lock|river|tidal_channel)$/] {
487 throwOther: tr("{0} together with {1}. The flow direction is defined by the way direction. Use {1} on {0} only in the rare case of a access restriction.", "{0.key}", "{1.key}");
488 group: tr("suspicious tag combination");
489}
490
491*[amenity][amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][!name][noname!=yes] {
492 throwOther: tr("{0} without {1}", "{0.tag}", "{2.key}");
493 group: tr("missing tag");
494 assertMatch: "node amenity=restaurant";
495 assertNoMatch: "node amenity=restaurant noname=yes";
496 assertNoMatch: "node amenity=restaurant name=Foobar";
497}
498
499/* #10193, #16157 */
500way[highway][barrier],
501*[highway][waterway][waterway!=dam][waterway!=weir],
502way[highway][natural][natural!=ridge],
503*[landuse][building][landuse!=retail] {
504 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
505 group: tr("suspicious tag combination");
506 assertNoMatch: "node highway=street_lamp natural=birds_nest";
507}
508
509/* #6932 */
510*[natural=water][leisure=swimming_pool] {
511 throwWarning: tr("natural water used for swimming pool");
512 group: tr("suspicious tag combination");
513 fixRemove: "natural";
514}
515
516/* #9593, #11183, #12418, #12761, #17254, #19311 */
517*[sport][sport!=skiing][!building][!club][tourism != hotel][highway !~ /^(pedestrian|raceway)$/][!leisure][natural !~ /^(beach|bare_rock|cliff|peak|water)$/][amenity !~ /^(bar|dojo|pub|restaurant|swimming_pool)$/][landuse !~ /^(recreation_ground|piste|farm|farmland)$/][barrier !~ /^(wall|retaining_wall)$/][!"piste:type"][shop!=sports][attraction!=summer_toboggan] {
518 throwWarning: tr("sport without physical feature");
519 group: tr("missing tag");
520 assertMatch: "node sport=tennis";
521 assertNoMatch: "node sport=tennis leisure=pitch";
522 assertNoMatch: "node sport=beachvolleyball natural=beach";
523 assertNoMatch: "node sport=skiing"; /* skiing has deprecated warning */
524 assertNoMatch: "node sport=swimming tourism=hotel";
525 assertNoMatch: "node sport=10pin amenity=restaurant";
526}
527
528/* {0.key} without {1.key} or {2.key} see #10140 */
529*[building:levels][!building][!building:part],
530way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] {
531 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
532 group: tr("missing tag");
533}
534
535/* any other *_name tag (with some exceptions) but not a name , see #10837 #11297 #11539 #16437 #17026 */
536*[/_name$/][!name][!old_name][!loc_name][!reg_name][!uic_name][!artist_name][!lock_name][!"osak:municipality_name"][!"osak:street_name"][noname!=yes] {
537 throwWarning: tr("alternative name without {0}", "{1.key}");
538 group: tr("missing tag");
539}
540
541/* #19604 */
542way[name][alt_name][name=*alt_name] {
543 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
544 group: tr("suspicious tag combination");
545 fixRemove: "alt_name";
546}
547
548/* #10837 */
549way[destination][!oneway?][junction!=roundabout][highway] {
550 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
551 suggestAlternative: "destination:forward";
552 suggestAlternative: "destination:backward";
553}
554
555/* #11389, #19010 */
556way[maxspeed:forward][maxspeed:backward][!maxspeed]["maxspeed:forward"=*"maxspeed:backward"] {
557 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
558 suggestAlternative: "maxspeed";
559 group: tr("suspicious tag combination");
560 fixChangeKey: "maxspeed:forward=>maxspeed";
561 fixRemove: "maxspeed:backward";
562}
563way[maxspeed:forward][maxspeed:backward][maxspeed]["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed] {
564 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
565 set AllSameMaxspeed;
566 suggestAlternative: "maxspeed";
567 group: tr("suspicious tag combination");
568 fixRemove: "maxspeed:forward";
569 fixRemove: "maxspeed:backward";
570}
571way[cycleway:left][cycleway:right][!cycleway]["cycleway:left"=*"cycleway:right"] {
572 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
573 suggestAlternative: "cycleway";
574 group: tr("suspicious tag combination");
575 fixChangeKey: "cycleway:left=>cycleway";
576 fixRemove: "cycleway:right";
577}
578way[cycleway:left][cycleway:right][cycleway]["cycleway:left"=*cycleway]["cycleway:right"=*cycleway] {
579 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
580 set AllSameCycleway;
581 suggestAlternative: "cycleway";
582 group: tr("suspicious tag combination");
583 fixRemove: "cycleway:left";
584 fixRemove: "cycleway:right";
585}
586way[sidewalk:left][sidewalk:right][!sidewalk]["sidewalk:left"=*"sidewalk:right"] {
587 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
588 suggestAlternative: "sidewalk";
589 group: tr("suspicious tag combination");
590 fixChangeKey: "sidewalk:left=>sidewalk";
591 fixRemove: "sidewalk:right";
592}
593way[sidewalk:left][sidewalk:right][sidewalk]["sidewalk:left"=*sidewalk]["sidewalk:right"=*sidewalk] {
594 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
595 set AllSameSidewalk;
596 suggestAlternative: "sidewalk";
597 group: tr("suspicious tag combination");
598 fixRemove: "sidewalk:left";
599 fixRemove: "sidewalk:right";
600}
601way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed,
602way["cycleway:left"]["cycleway:right"][cycleway]!.AllSameCycleway,
603way["sidewalk:left"]["sidewalk:right"][sidewalk]!.AllSameSidewalk {
604 throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
605 group: tr("suspicious tag combination");
606}
607way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
608way["maxspeed:backward"][maxspeed][!"maxspeed:forward"],
609way["cycleway:left"][cycleway][!"cycleway:right"],
610way["cycleway:right"][cycleway][!"cycleway:left"],
611way["sidewalk:left"][sidewalk][!"sidewalk:right"],
612way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
613 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
614 group: tr("suspicious tag combination");
615}
616
617/* #11837 */
618way[layer][layer<0][bridge][bridge!=no][location!=underground][indoor!=yes][!tunnel],
619way[layer][layer>0][tunnel][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
620 throwWarning: tr("{0} together with {1}", "{2.tag}", "{0.tag}");
621 group: tr("suspicious tag combination");
622}
623
624/* #12942 */
625relation[oneway][type!=route] {
626 throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
627}
628
629/* #9182 */
630way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
631 throwWarning: tr("Long waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
632 group: tr("suspicious tag combination");
633}
634way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
635 throwOther: tr("Short waterway with {0} but without a tag which defines it as tunnel or underground. Remove {1} or add a tunnel tag if applicable. Also check crossing bridges and their {1} tags.", "{1.tag}", "{1.key}");
636 group: tr("suspicious tag combination");
637}
638
639/* #13144, #15536 */
640*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
641*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
642 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
643 group: tr("suspicious tag combination");
644}
645*[unisex=yes][female=yes][male=yes][shop=hairdresser] {
646 throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
647 group: tr("suspicious tag combination");
648 fixRemove: "female";
649 fixRemove: "male";
650}
651*[female=yes][male=yes][!unisex][shop=hairdresser] {
652 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
653 suggestAlternative: "unisex=yes";
654 group: tr("suspicious tag combination");
655 fixRemove: "female";
656 fixRemove: "male";
657 fixAdd: "unisex=yes";
658}
659
660/* {1.key} without {2.tag} see #13138, #14468 */
661way!:closed[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir], /* water=intermittent is deprecated and has an own warning */
662area:closed[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir] {
663 throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
664 group: tr("missing tag");
665}
666
667/* #13680 */
668area[golf=bunker][natural=beach] {
669 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
670 suggestAlternative: "natural=sand";
671 suggestAlternative: "surface=sand";
672 group: tr("suspicious tag combination");
673}
674
675/* #13705 */
676relation[type=multipolygon][building] > way {
677 set part_of_building_MP;
678}
679way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier][place!=plot]!.part_of_building_MP {
680 /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
681 throwOther: tr("possibly missing {0} tag", "{1.key}");
682 group: tr("missing tag");
683}
684
685/* see #8519, #11529, limited to motorways and trunks to avoid false positives for streets with lanes for non motorized traffic */
686way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/] {
687 set MotorwayTrunk;
688}
689way.MotorwayTrunk[lanes][turn:lanes ][tag(lanes)!=eval(count(split("|", tag("turn:lanes"))))],
690way.MotorwayTrunk[lanes][change:lanes ][tag(lanes)!=eval(count(split("|", tag("change:lanes"))))],
691way.MotorwayTrunk[lanes][maxspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("maxspeed:lanes"))))],
692way.MotorwayTrunk[lanes][minspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("minspeed:lanes"))))],
693way.MotorwayTrunk[lanes][destination:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:lanes"))))],
694way.MotorwayTrunk[lanes][destination:ref:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:ref:lanes"))))],
695way.MotorwayTrunk[lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
696 throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
697 group: tr("suspicious tag combination");
698}
699
700/* #14125, #14323, #18185 */
701way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][oneway!=reversible][highway!=motorway][junction!=roundabout][lanes>2][mod(tag(lanes),2)=1] {
702 throwWarning: tr("street with odd number of {0}, but without {1} and {2} or {3}", "{1.key}", "{2.key}", "{3.key}", "{4.key}");
703 group: tr("missing tag");
704 assertNoMatch: "way highway=primary lanes=2";
705 assertNoMatch: "way highway=primary lanes=3 lanes:backward=2";
706 assertNoMatch: "way highway=primary lanes=3 oneway=-1";
707 assertNoMatch: "way highway=primary lanes=4";
708 assertMatch: "way highway=primary lanes=3";
709}
710
711/* #10932, #19609 */
712way[highway][!lanes][/^.*:lanes$/][!source:lanes],
713way[highway][!lanes][/^.*:lanes:(forward|backward|both_ways)$/],
714way[highway][!lanes:both_ways][/^.*:lanes:both_ways$/] {
715 throwWarning: tr("{0} without {1}", "{2.key}", "{1.key}");
716 group: tr("missing tag");
717 assertMatch: "way highway=primary turn:lanes=left|right";
718 assertMatch: "way highway=primary turn:lanes:forward=left|right";
719 assertNoMatch: "way highway=primary turn:lanes=left|right lanes=2";
720}
721way[highway][!lanes:forward][/^.*:lanes:forward$/][!lanes:backward][mod(tag(lanes),2)=0],
722way[highway][!lanes:backward][/^.*:lanes:backward$/][!lanes:forward][mod(tag(lanes),2)=0] {
723 throwOther: tr("{0} without {1}", "{2.key}", "{1.key}");
724 group: tr("missing tag");
725 assertMatch: "way highway=primary turn:lanes:forward=left|right lanes=2";
726 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes:forward=2";
727 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes=3";
728}
729
730/* #15774 */
731node[emergency=fire_hydrant][fire_hydrant:count][fire_hydrant:count!=1] {
732 throwOther: tr("{0} together with {1}. Tag each hydrant separately.", "{0.tag}", "{1.tag}");
733}
734
735/* #12502 */
736node[leisure=park][natural=tree] {
737 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
738 group: tr("suspicious tag combination");
739 fixRemove: "leisure";
740}
741
742/* #17305 */
743area[boundary=administrative][landuse=residential] {
744 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
745 group: tr("suspicious tag combination");
746}
747
748/* #17391 */
749way[highway=pedestrian][width][width<3] {
750 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
751 suggestAlternative: "highway=footway";
752 group: tr("suspicious tag combination");
753 fixAdd: "highway=footway";
754 assertMatch: "way highway=pedestrian width=0.8";
755 assertMatch: "way highway=pedestrian width=1";
756 assertNoMatch: "way highway=pedestrian width=3";
757 assertNoMatch: "way highway=pedestrian width=5.5";
758}
759
760/* see #17623 */
761way:areaStyle[highway][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service$|living_street|pedestrian|track|path|footway|cycleway|busway|bus_guideway|bridleway/][area!=yes] {
762 throwOther: tr("A linear object {0} without {1} has a tag indicating that it is an area.", "{1.tag}", "{3.tag}");
763 group: tr("suspicious tag combination");
764}
765
766/* #17804 */
767area[cemetery=sector][landuse=cemetery] {
768 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
769 group: tr("suspicious tag combination");
770}
771
772/* #17967 */
773*[highway=cycleway][cycleway=track] {
774 throwWarning: tr("{0} together with {1}. Remove {1}.", "{0.tag}", "{1.tag}");
775 group: tr("suspicious tag combination");
776 fixRemove: "cycleway";
777}
778
779/* #17973, #18183, #18331, #20318 */
780way[highway=path ][!segregated][foot=designated][bicycle=designated],
781way[highway=footway ][!segregated][bicycle=designated],
782way[highway=cycleway][!segregated][foot=designated] {
783 throwWarning: tr("Combined foot- and cycleway without {0}.", "{1.key}");
784 group: tr("missing tag");
785}
786
787/* #17989 */
788node[emergency_ward_entrance][emergency!=emergency_ward_entrance] {
789 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
790 group: tr("missing tag");
791 fixAdd: "emergency=emergency_ward_entrance";
792}
793
794/* missing or conflicting construction, see #17607 */
795/* {0.key} without {1.key} and {2.key} */
796*[construction:building][!building][!construction],
797*[construction:highway][!highway][!construction],
798*[construction:railway][!railway][!construction],
799*[construction:landuse][!landuse][!construction] {
800 throwWarning: tr("{0} without {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
801 group: tr("missing tag");
802 fixAdd: "{1.key}=construction";
803 fixAdd: "construction={0.value}";
804 assertMatch: "way construction:building=house";
805 assertNoMatch: "way construction:building=house building=house ";
806 assertNoMatch: "way construction:building=house construction=house";
807}
808/* {0.key} and {1.key} without {2.key} */
809*[building=construction]["construction:building"][!construction],
810*[highway=construction]["construction:highway"][!construction],
811*[railway=construction]["construction:railway"][!construction],
812*[landuse=construction]["construction:landuse"][!construction] {
813 throwWarning: tr("{0} together with {1} but without {2}", "{0.key}", "{1.key}", "{2.key}");
814 group: tr("missing tag");
815 fixAdd: "construction={1.value}";
816 assertMatch: "way construction:building=house building=construction";
817 assertNoMatch: "way construction:building=house building=house ";
818 assertNoMatch: "way construction:building=house construction=house";
819}
820/* {0.key} and {1.key} without {2.key} */
821*[building]["construction:building"][!construction][building!=construction],
822*[highway]["construction:highway"][!construction][highway!=construction],
823*[railway]["construction:railway"][!construction][railway!=construction],
824*[landuse]["construction:landuse"][!construction][landuse!=construction] {
825 throwWarning: tr("{0} together with {1} and conflicting values plus no {2}", "{0.key}", "{1.key}", "{2.key}");
826 group: tr("suspicious tag combination");
827 assertMatch: "way construction:building=house building=office";
828 assertNoMatch: "way construction:building=house building=construction";
829 assertNoMatch: "way construction:building=house construction=house";
830}
831
832*["construction:building"][construction][construction:building != *construction],
833*["construction:highway"][construction][construction:highway != *construction],
834*["construction:railway"][construction][construction:railway != *construction],
835*["construction:landuse"][construction][construction:landuse != *construction] {
836 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
837 group: tr("suspicious tag combination");
838 assertMatch: "way construction:building=house construction=office";
839 assertNoMatch: "way construction:building=house construction=house";
840}
841
842/* #18203 */
843way[construction][construction!=yes][construction!=minor][highway][highway!=construction] {
844 throwWarning: tr("{0} together with {1}", "{3.tag}", "{0.tag}");
845 group: tr("suspicious tag combination");
846}
847
848/* #18374 */
849*[amenity=recycling][collection_times="24/7"][!opening_hours],
850*[amenity=recycling][collection_times ][!opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
851 throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
852 group: tr("suspicious tag combination");
853 fixChangeKey: "collection_times => opening_hours";
854 assertMatch: "node amenity=recycling collection_times=\"Mo-Fr 06:00-20:00\"";
855 assertNoMatch: "node amenity=recycling collection_times=\"Mo-Fr 15:00\"";
856 assertNoMatch: "node amenity=recycling collection_times=\"Mo 08:00-11:00\"";
857 assertNoMatch: "node amenity=recycling collection_times=\"Sa[2,4] 8:00-11:00\"";
858}
859*[amenity=recycling][collection_times="24/7"][opening_hours],
860*[amenity=recycling][collection_times ][opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
861 throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
862 group: tr("suspicious tag combination");
863}
864
865/* #19018 */
866way[highway][crossing][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] {
867 throwWarning: tr("{0} together with {1}. Should be used on a minor highway type or a node", "{1.key}", "{0.tag}");
868 group: tr("suspicious tag combination");
869 fixRemove: "crossing";
870 assertMatch: "way highway=trunk crossing=unmarked";
871 assertNoMatch: "way highway=construction construction=footway crossing=unmarked";
872}
873
874/* #19066 */
875*[amenity=recycling][!/^recycling:/][recycling_type!=centre] {
876 throwWarning: tr("{0} without {1}", "{0.tag}", "recycling:*");
877 group: tr("missing tag");
878}
879*[source:addr][!/^addr:/] {
880 throwWarning: tr("{0} without {1}", "{0.key}", "addr:*");
881 group: tr("missing tag");
882 assertMatch: "node source:addr=postman";
883 assertNoMatch: "node source:addr=postman addr:housenumber=42";
884}
885*[source:maxspeed][!/^maxspeed:?/] {
886 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
887 group: tr("missing tag");
888}
889
890/* #16898, tower vs. communications_tower, wiki suggests 100m as rough guideline, so we warn for < 75m */
891*[man_made=communications_tower][height][height =~ /^((7[0-4]|[1-6]?[0-9])(\.[0-9]*)?( m)?|(2(4[0-5]|[0-3][0-9])|1?[0-9]?[0-9])((\.[0-9]*)?( ft|\')|\'(11|10|[0-9])(\.[0-9]*)?\"))$/] { /* 75m ~ 246ft ~ 246' */
892 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
893 suggestAlternative: "man_made=tower + tower:type=communication + height";
894 group: tr("suspicious tag combination");
895 assertMatch: "node man_made=communications_tower height=58";
896 assertMatch: "node man_made=communications_tower height=\"74 m\"";
897 assertMatch: "node man_made=communications_tower height=0.8";
898 assertMatch: "node man_made=communications_tower height=245'";
899 assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
900 assertMatch: "node man_made=communications_tower height=231'10.22\"";
901 assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
902 assertNoMatch: "node man_made=communications_tower height=75.72";
903 assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
904 assertNoMatch: "node man_made=communications_tower height=4358'8\"";
905 assertNoMatch: "node height=4358'";
906}
907
908/* #17296, If the value of fixme is only an osm key, it is often a leftover from a time when the object didn't have this key. The fixme was forgotten to remove when the key was added. Or the value of fixme should be described better what exactly needs to be fixed. */
909*[fixme][count(split(" ", tag("fixme"))) == 1][has_tag_key(tag("fixme"))],
910*[FIXME][count(split(" ", tag("FIXME"))) == 1][has_tag_key(tag("FIXME"))] {
911 throwWarning: tr("{0} together with {1}. Is the fixme fixed?", "{0.tag}", "{0.value}");
912 group: tr("suspicious tag combination");
913 assertMatch: "way name=\"Florist Gump\" fixme=name";
914 assertMatch: "way name=\"Florist Gump\" FIXME=name";
915 assertNoMatch: "way fixme=name";
916 assertNoMatch: "way name=\"Florist Gump\"";
917 assertNoMatch: "way name=\"Florist Gump\" fixme=\"the name might have changed\"";
918}
919
920/* #19094 */
921way[highway][placement=transition][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition],
922way[highway][!placement][/^placement:.*$/][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition] {
923 throwWarning: tr("Use {0} only as value of {1}", "transition", "placement");
924 set PlacementTransitionWarning;
925 fixAdd: "placement=transition";
926 fixRemove: "placement:forward";
927 fixRemove: "placement:backward";
928 fixRemove: "placement:both_ways";
929 assertMatch: "way highway=primary placement=transition placement:both_ways=transition";
930 assertMatch: "way highway=primary placement:backward=transition placement:forward=transition";
931 assertNoMatch: "way highway=primary placement:backward=middle_of:1 placement:forward=transition";
932 assertNoMatch: "way highway=primary placement=middle_of:1 placement:backward=transition placement:forward=transition";
933}
934way[highway][placement][/^placement:.*$/]!.PlacementTransitionWarning,
935way[highway]["placement:forward"]["placement:backward"]!.PlacementTransitionWarning,
936way[highway]["placement:forward"]["placement:both_ways"]!.PlacementTransitionWarning,
937way[highway]["placement:backward"]["placement:both_ways"]!.PlacementTransitionWarning {
938 throwError: tr("{0} together with {1}", "{1.key}", "{2.key}");
939 group: tr("suspicious tag combination");
940 assertMatch: "way highway=primary placement=left_of:2 placement:forward=right_of:1";
941 assertNoMatch: "way highway=primary placement:forward=right_of:1";
942 assertNoMatch: "way highway=primary placement:forward=transition placement:both_ways=transition";
943}
944
945/* #19742 */
946node:righthandtraffic[highway=mini_roundabout][direction=clockwise] {
947 throwWarning: tr("{0} together with {1} at right-hand traffic", "{1.tag}", "{2.tag}");
948 group: tr("suspicious tag combination");
949}
950node!:righthandtraffic[highway=mini_roundabout][direction=anticlockwise] {
951 throwWarning: tr("{0} together with {1} at left-hand traffic", "{1.tag}", "{2.tag}");
952 group: tr("suspicious tag combination");
953}
954
955/* #19603 */
956way[footway][highway][footway=sidewalk ][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
957 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
958 group: tr("suspicious tag combination");
959 suggestAlternative: "sidewalk=left";
960 suggestAlternative: "sidewalk=right";
961 suggestAlternative: "sidewalk=both";
962 suggestAlternative: "sidewalk=separate";
963}
964way[footway][highway][footway!=sidewalk][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
965 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
966 group: tr("suspicious tag combination");
967}
968way[footway][!highway][!/:highway$/],
969way[cycleway][!highway][!/:highway$/] {
970 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
971 group: tr("missing tag");
972 assertNoMatch: "way footway=sidewalk abandoned:highway=unclassified";
973}
974
975/* #17498 */
976way[bicycle][/^cycleway(:|$)/][!/^bicycle:/][bicycle=~/^(no|use_sidepath)$/][/^cycleway(:|$)/!~/^(no|none|separate)$/] {
977 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
978 group: tr("suspicious tag combination");
979 assertMatch: "way bicycle=no cycleway=track";
980 assertMatch: "way bicycle=use_sidepath cycleway=lane";
981 assertMatch: "way bicycle=use_sidepath cycleway:left=lane";
982 assertNoMatch: "way bicycle=use_sidepath cycleway=no";
983 assertNoMatch: "way bicycle=use_sidepath bicycle:backward=yes cycleway:left=lane"; /* instead of :backward, could also be :forward or :conditional */
984 assertNoMatch: "way bicycle=no cycleway:right=no";
985 assertNoMatch: "way bicycle=use_sidepath cycleway:left=none";
986 assertNoMatch: "way highway=cycleway cycleway=separate";
987 assertNoMatch: "way highway=residential bicycle=use_sidepath";
988}
989
990/* #19980 */
991way[highway=living_street][maxspeed][maxspeed=~/mph/][get(split(" ", tag(maxspeed)), 0) > 15],
992way[highway=living_street][maxspeed][maxspeed!~/mph/][get(split(" ", tag(maxspeed)), 0) > 20] {
993 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
994 group: tr("suspicious tag combination");
995 assertNoMatch: "way highway=living_street";
996 assertNoMatch: "way highway=living_street maxspeed=20";
997 assertNoMatch: "way highway=living_street maxspeed=\"15 mph\"";
998 assertNoMatch: "way highway=living_street maxspeed=walk";
999 assertMatch: "way highway=living_street maxspeed=30";
1000 assertMatch: "way highway=living_street maxspeed=\"20 mph\"";
1001}
1002
1003/* piste subtags, see #17606 */
1004way[piste:type=nordic][!piste:grooming] {
1005 throwWarning: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1006 group: tr("missing tag");
1007 assertMatch: "way piste:type=nordic";
1008 assertNoMatch: "way piste:type=nordic piste:grooming=classic";
1009}
1010
1011way[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty][count(parent_tags("piste:difficulty")) == 0] {
1012 set missing_parent_piste_difficulty;
1013}
1014way.missing_parent_piste_difficulty:new,
1015way.missing_parent_piste_difficulty:in-downloaded-area!:new {
1016 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1017 group: tr("missing tag");
1018 set missing_piste_difficulty;
1019 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1020}
1021relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] >
1022 way[!piste:difficulty]!.missing_piste_difficulty {
1023 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1024 group: tr("missing tag");
1025 set missing_piste_difficulty_both;
1026 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1027}
1028way[piste:type=nordic][!piste:difficulty]!.missing_piste_difficulty!.missing_piste_difficulty_both {
1029 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1030 group: tr("missing tag");
1031 assertMatch: "way piste:type=nordic";
1032 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1033}
1034
1035relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] {
1036 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1037 group: tr("missing tag");
1038 assertMatch: "relation piste:type=nordic";
1039 assertNoMatch: "relation piste:type=nordic piste:difficulty=easy";
1040}
1041relation[piste:type=nordic][!piste:grooming]{
1042 throwOther: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1043 group: tr("missing tag");
1044 assertMatch: "relation piste:type=nordic";
1045 assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
1046}
Note: See TracBrowser for help on using the repository browser.