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

Last change on this file since 18546 was 18546, checked in by Klumbumbus, 3 years ago

Fix #22295, see #18374 - Don't warn about "collection_times together with amenity=recycling. Probably opening_hours is meant." for cases when also opening_hours is set.

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