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

Last change on this file since 18674 was 18674, checked in by taylor.smock, 17 months ago

Fix #21778: oneway + .*:(backward|forward):conditional should not have a warning (patch by Famlam)

  • Property svn:eol-style set to native
File size: 53.6 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*[archaeological_site ][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/* {0.key} without {1.key} or {2.tag}, #22547 */
247way[tunnel=culvert][man_made!=tunnel][!waterway] {
248 throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.key}");
249 group: tr("suspicious tag combination");
250 set TunnelCulvertWithoutWaterway;
251}
252
253/* {0.tag} without {1.tag} (info level) see #11600 #11393 #11850 */
254way[highway=motorway][!oneway][junction!=roundabout],
255way[highway=motorway_link][!oneway][junction!=roundabout] {
256 throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
257 group: tr("missing tag");
258}
259
260/* {0.tag} without {1.tag} */
261way[usage=penstock][man_made!=pipeline],
262way[usage=penstock][waterway!=pressurised] {
263 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
264 group: tr("missing tag");
265}
266
267/* {0.tag} without {1.tag} or {2.tag} */
268*[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
269 throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
270 group: tr("missing tag");
271}
272
273/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.key} */
274*[smoothness][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/][barrier!=kerb][!kerb] {
275 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.key}");
276 group: tr("missing tag");
277}
278
279/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.tag} */
280*[intermittent ][!waterway][natural!~/^(water|spring)$/][landuse!~/^(basin|reservoir)$/][ford!~/^(yes|stepping_stones)$/],
281*[boat ][!waterway][natural!=water ][landuse!~/^(basin|reservoir)$/][ford!=yes] {
282 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
283 group: tr("missing tag");
284}
285
286/* {0.key} without {1.key}, {2.key} or {3.key} */
287*[snowplowing][!highway][!amenity][!leisure] {
288 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
289 group: tr("missing tag");
290}
291
292/* {0.key} without {1.key}, {2.key} or {3.tag} */
293*[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
294 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
295 group: tr("missing tag");
296}
297
298/* {0.tag} together with {1.key}, see #22576, #17664, #17707, #16464, #10837, #14034, #9389, #11977, #13156, #16888, #20530, #21736, #22076, #21778 */
299*[amenity=marketplace][highway],
300*[power=plant][/^generator:/],
301*[power=generator][/^plant:/],
302*[power=plant][voltage],
303*[power=plant][frequency],
304*[internet_access=no][internet_access:fee],
305node[power=transformer][voltage],
306node[transformer=distribution][voltage][power=pole],
307*[amenity=vending_machine][shop],
308*[noname?][name],
309*[noref?][ref],
310*[nohousenumber?][addr:housenumber],
311*[actuator][handle][actuator !~ /(^|;)manual(;|$)/],
312*[mechanical_driver][handle][mechanical_driver !~ /(^|;)manual(;|$)/],
313way[oneway? ][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/][!/^oneway:(.+:)?conditional$/],
314way[oneway? ][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/][!/^oneway:(.+:)?conditional$/],
315way[oneway=-1][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/][!/^oneway:(.+:)?conditional$/],
316way[oneway=-1][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/][!/^oneway:(.+:)?conditional$/] {
317 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
318 group: tr("suspicious tag combination");
319 assertMatch: "way power=plant generator:source=wind";
320 assertMatch: "way power=generator plant:source=combustion";
321 assertMatch: "way oneway=yes bicycle:backward=destination";
322 assertNoMatch: "way oneway=-1 bicycle:forward=destination oneway:bicycle=no";
323 assertNoMatch: "way oneway=yes bicycle:backward=destination oneway:bicycle=no";
324 assertNoMatch: "way oneway=yes bicycle:backward:conditional=\"yes @ (Mo-Fr)\" oneway:bicycle:conditional=\"no @ (Mo-Fr)\"";
325}
326
327/* {0.tag} together with {1.tag} (info level), see #9696 */
328way[highway=footway][oneway=no] {
329 throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
330 group: tr("suspicious tag combination");
331}
332
333/* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186, #18815, #20960 */
334*[barrier=kerb][kerb=no],
335way[highway=construction][construction][construction=~/^(yes|minor|no)$/],
336way[railway=construction][construction][construction=~/^(yes|minor|no)$/],
337area[building=construction][construction][construction=~/^(yes|minor|no)$/],
338area[landuse=construction][construction][construction=~/^(yes|minor|no)$/],
339*[man_made=bridge][bridge=yes],
340*[man_made=tunnel][tunnel=yes],
341*[amenity=police][police],
342node[highway=crossing][crossing=no],
343node[railway=crossing][crossing=no],
344way[junction=yes][highway],
345way[tracktype=grade1][surface].unpaved_surface,
346way[tracktype=grade2][surface][surface=~/^(sand|mud|ground|earth|dirt|grass|ice|salt|snow|woodchips)$/],
347way[tracktype=grade4][surface].fully_paved_surface,
348way[tracktype=grade5][surface].fully_paved_surface,
349way[segregated][bicycle=no],
350way[segregated][foot=no],
351way[man_made=pipeline][tunnel=flooded] {
352 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
353 group: tr("suspicious tag combination");
354}
355
356/* {0.tag} together with {1.tag} (error level) */
357relation[type=multipolygon][area=no] {
358 throwError: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
359 group: tr("suspicious tag combination");
360}
361
362/* {0.key} together with {1.key}, #18267, #17630, #17604, #21836 */
363node[transformer][voltage],
364node[marker][cover],
365node[marker][voltage],
366node[marker][pressure],
367node[marker][diameter],
368node[marker][substance],
369*[building:part][building],
370*[addr:street][addr:place][outside("CZ,DK")] {
371 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
372 group: tr("suspicious tag combination");
373}
374
375/* {0.tag} together with {1.tag} and {2.key}, #18471 */
376way[highway=~/^(cycleway|footway|path)$/][segregated=no][sidewalk =~/^(left|right|both)$/] {
377 throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.tag}", "{2.key}");
378 group: tr("suspicious tag combination");
379}
380
381/* {0.key} together with {1.tag} and {2.key}, #19747 */
382way[railway][electrified=no][frequency],
383way[railway][electrified=no][voltage] {
384 throwWarning: tr("{0} together with {1} and {2}", "{0.key}", "{1.tag}", "{2.key}");
385 group: tr("suspicious tag combination");
386}
387
388/* #11127, #13727 */
389way[waterway][bridge=yes][waterway!=weir] {
390 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
391 suggestAlternative: "bridge=aqueduct";
392 group: tr("suspicious tag combination");
393 fixAdd: "bridge=aqueduct";
394}
395way[waterway=weir][bridge=yes][highway] {
396 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
397 suggestAlternative: "waterway=weir + ford=yes";
398 suggestAlternative: "waterway=dam";
399 suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
400 group: tr("suspicious tag combination");
401}
402
403/* #16214 */
404relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
405 throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
406 fixRemove: "area";
407 set area_yes_autofix;
408 group: tr("suspicious tag combination");
409}
410
411/* only {0.key}, #11104, #12422, #14950, #19572, #20902 */
412/* relations excluded as there is a test for missing type=* plus several other test depending on the type exist */
413node[access][eval(number_of_tags()) = 1],
414way[access][eval(number_of_tags()) = 1],
415node[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
416way[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
417node[lanes][eval(number_of_tags()) = 1],
418way[lanes][eval(number_of_tags()) = 1],
419node[layer][eval(number_of_tags()) = 1],
420way[layer][eval(number_of_tags()) = 1],
421way[level][eval(number_of_tags()) = 1], /* nodes might be valid, e.g. start and end nodes of steps */
422node[lit][eval(number_of_tags()) = 1],
423way[lit][eval(number_of_tags()) = 1],
424node[name][eval(number_of_tags()) = 1],
425way[name][eval(number_of_tags()) = 1],
426node[ref][eval(number_of_tags()) = 1],
427way[ref][eval(number_of_tags()) = 1],
428node[surface][eval(number_of_tags()) = 1],
429way[surface][eval(number_of_tags()) = 1] {
430 throwWarning: tr("incomplete object: only {0}", "{0.key}");
431 set only_one_tag;
432 group: tr("missing tag");
433}
434/* only {0.key} and {1.key} */
435node[name][area][eval(number_of_tags()) = 2],
436way[name][area][eval(number_of_tags()) = 2],
437node[name][ref][eval(number_of_tags()) = 2],
438way[name][ref][eval(number_of_tags()) = 2] {
439 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
440 group: tr("missing tag");
441}
442/* only {0.tag}, #15269 */
443node[tourism=attraction][eval(number_of_tags()) = 1],
444way[tourism=attraction][eval(number_of_tags()) = 1] {
445 throwWarning: tr("incomplete object: only {0}", "{0.tag}");
446 group: tr("missing tag");
447}
448/* only {0.key} and {1.tag} */
449node[name][tourism=attraction][eval(number_of_tags()) = 2],
450way[name][tourism=attraction][eval(number_of_tags()) = 2] {
451 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
452 group: tr("missing tag");
453}
454
455/* #9811, #11491, #12865, #14310 */
456*[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)$/],
457/* addr:postcode is used together with place in some countries */
458*[boundary][/^addr:/],
459*[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
460 throwWarning: tr("{0} together with {1}", "{0.key}", "addr:*");
461 group: tr("suspicious tag combination");
462 assertMatch: "node place=foo addr:housenumber=5";
463 assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
464 assertNoMatch: "node place=foo addr:postcode=12345";
465}
466*[postal_code]["addr:postcode"][!highway][postal_code=*"addr:postcode"] {
467 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
468 group: tr("suspicious tag combination");
469}
470*[postal_code]["addr:postcode"][!highway][postal_code!=*"addr:postcode"] {
471 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
472 group: tr("suspicious tag combination");
473}
474way[postal_code]["addr:postcode"][highway][postal_code=*"addr:postcode"] {
475 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
476 group: tr("suspicious tag combination");
477 fixRemove: "addr:postcode";
478}
479way[postal_code]["addr:postcode"][highway][postal_code!=*"addr:postcode"] {
480 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
481 group: tr("suspicious tag combination");
482}
483way[highway]["addr:postcode"][highway!=services][highway!=rest_area][!postal_code] {
484 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
485 suggestAlternative: "postal_code";
486 group: tr("suspicious tag combination");
487 fixChangeKey: "addr:postcode=>postal_code";
488}
489
490/* #9195 */
491way[highway=footway][cycleway=lane] {
492 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
493 suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
494 group: tr("suspicious tag combination");
495}
496
497/* {0} on suspicious object, #17255, #19650, #19572, #17253, #19821, #15667, #19930, #20435, #20471, #18815 */
498way[oneway ][!highway][!area:highway][!railway][!aerialway][attraction!=summer_toboggan][aeroway!~/^(runway|taxiway)$/][leisure!=track][waterway !~ /^(canal|fairway|lock|river|tidal_channel)$/],
499node[lanes ][!barrier][!ford][highway!=mini_roundabout][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
500way[lanes ][!barrier][!ford][!highway ][!area:highway][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
501*[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]!.TunnelCulvertWithoutWaterway,
502*[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],
503*[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.*/],
504*[width ][!highway][!area:highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track],
505*[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],
506way[incline][!highway][!area:highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan][leisure!=slipway] {
507 throwWarning: tr("{0} on suspicious object", "{0.key}");
508 group: tr("suspicious tag combination");
509}
510
511/* #15667, #19930 */
512way[waterway][oneway][waterway =~ /^(canal|fairway|lock|river|tidal_channel)$/] {
513 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}");
514 group: tr("suspicious tag combination");
515}
516
517*[amenity][!name][amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][noname!=yes] {
518 throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
519 group: tr("missing tag");
520 assertMatch: "node amenity=restaurant";
521 assertNoMatch: "node amenity=restaurant noname=yes";
522 assertNoMatch: "node amenity=restaurant name=Foobar";
523}
524
525/* #10193, #16157 */
526way[highway][barrier],
527*[highway][waterway][waterway!=dam][waterway!=weir],
528way[highway][natural][natural!=ridge],
529*[landuse][building][landuse!=retail] {
530 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
531 group: tr("suspicious tag combination");
532 assertNoMatch: "node highway=street_lamp natural=birds_nest";
533}
534
535/* #6932 */
536*[natural=water][leisure=swimming_pool] {
537 throwWarning: tr("natural water used for swimming pool");
538 group: tr("suspicious tag combination");
539 fixRemove: "natural";
540}
541
542/* #9593, #11183, #12418, #12761, #17254, #19311 */
543*[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] {
544 throwWarning: tr("sport without physical feature");
545 group: tr("missing tag");
546 assertMatch: "node sport=tennis";
547 assertNoMatch: "node sport=tennis leisure=pitch";
548 assertNoMatch: "node sport=beachvolleyball natural=beach";
549 assertNoMatch: "node sport=skiing"; /* skiing has deprecated warning */
550 assertNoMatch: "node sport=swimming tourism=hotel";
551 assertNoMatch: "node sport=10pin amenity=restaurant";
552}
553
554/* {0.key} without {1.key} or {2.key} see #10140 */
555*[building:levels][!building][!building:part],
556way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] {
557 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
558 group: tr("missing tag");
559}
560
561/* any other *_name tag (with some exceptions) but not a name , see #10837 #11297 #11539 #16437 #17026 #22033 */
562*[/_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] {
563 throwWarning: tr("alternative name without {0}", "{1.key}");
564 group: tr("missing tag");
565 assertMatch: "way alt_name=Foo";
566 assertNoMatch: "way alt_name=Foo name=Bar";
567}
568
569/* #19604 */
570way[name][alt_name][name=*alt_name] {
571 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
572 group: tr("suspicious tag combination");
573 fixRemove: "alt_name";
574}
575
576/* #10837 */
577way[destination][!oneway?][junction!=roundabout][highway] {
578 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
579 suggestAlternative: "destination:forward";
580 suggestAlternative: "destination:backward";
581}
582
583/* #11389, #19010 */
584way[maxspeed:forward][maxspeed:backward][!maxspeed]["maxspeed:forward"=*"maxspeed:backward"] {
585 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
586 suggestAlternative: "maxspeed";
587 group: tr("suspicious tag combination");
588 fixChangeKey: "maxspeed:forward=>maxspeed";
589 fixRemove: "maxspeed:backward";
590}
591way[maxspeed:forward][maxspeed:backward][maxspeed]["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed] {
592 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
593 set AllSameMaxspeed;
594 suggestAlternative: "maxspeed";
595 group: tr("suspicious tag combination");
596 fixRemove: "maxspeed:forward";
597 fixRemove: "maxspeed:backward";
598}
599way[cycleway:left][cycleway:right][!cycleway]["cycleway:left"=*"cycleway:right"] {
600 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
601 suggestAlternative: "cycleway";
602 group: tr("suspicious tag combination");
603 fixChangeKey: "cycleway:left=>cycleway";
604 fixRemove: "cycleway:right";
605}
606way[cycleway:left][cycleway:right][cycleway]["cycleway:left"=*cycleway]["cycleway:right"=*cycleway] {
607 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
608 set AllSameCycleway;
609 suggestAlternative: "cycleway";
610 group: tr("suspicious tag combination");
611 fixRemove: "cycleway:left";
612 fixRemove: "cycleway:right";
613}
614way[sidewalk:left][sidewalk:right][!sidewalk]["sidewalk:left"=*"sidewalk:right"] {
615 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
616 suggestAlternative: "sidewalk";
617 group: tr("suspicious tag combination");
618 fixChangeKey: "sidewalk:left=>sidewalk";
619 fixRemove: "sidewalk:right";
620}
621way[sidewalk:left][sidewalk:right][sidewalk]["sidewalk:left"=*sidewalk]["sidewalk:right"=*sidewalk] {
622 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
623 set AllSameSidewalk;
624 suggestAlternative: "sidewalk";
625 group: tr("suspicious tag combination");
626 fixRemove: "sidewalk:left";
627 fixRemove: "sidewalk:right";
628}
629way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed,
630way["cycleway:left"]["cycleway:right"][cycleway]!.AllSameCycleway,
631way["sidewalk:left"]["sidewalk:right"][sidewalk]!.AllSameSidewalk {
632 throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
633 group: tr("suspicious tag combination");
634}
635way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
636way["maxspeed:backward"][maxspeed][!"maxspeed:forward"],
637way["cycleway:left"][cycleway][!"cycleway:right"],
638way["cycleway:right"][cycleway][!"cycleway:left"],
639way["sidewalk:left"][sidewalk][!"sidewalk:right"],
640way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
641 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
642 group: tr("suspicious tag combination");
643}
644
645/* #11837 */
646way[bridge][layer][layer<0][bridge!=no][location!=underground][indoor!=yes][!tunnel],
647way[tunnel][layer][layer>0][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
648 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
649 group: tr("suspicious tag combination");
650}
651
652/* #12942 */
653relation[oneway][type!=route] {
654 throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
655}
656
657/* #9182 */
658way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
659 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}");
660 group: tr("suspicious tag combination");
661}
662way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
663 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}");
664 group: tr("suspicious tag combination");
665}
666
667/* #13144, #15536 */
668*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
669*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
670 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
671 group: tr("suspicious tag combination");
672}
673*[unisex=yes][female=yes][male=yes][shop=hairdresser] {
674 throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
675 group: tr("suspicious tag combination");
676 fixRemove: "female";
677 fixRemove: "male";
678}
679*[female=yes][male=yes][!unisex][shop=hairdresser] {
680 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
681 suggestAlternative: "unisex=yes";
682 group: tr("suspicious tag combination");
683 fixRemove: "female";
684 fixRemove: "male";
685 fixAdd: "unisex=yes";
686}
687
688/* {0.key} without {1.tag} see #13138, #14468 */
689way[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]!:closed, /* water=intermittent is deprecated and has an own warning */
690area[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]:closed {
691 throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
692 group: tr("missing tag");
693}
694
695/* #13680 */
696area[golf=bunker][natural=beach] {
697 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
698 suggestAlternative: "natural=sand";
699 suggestAlternative: "surface=sand";
700 group: tr("suspicious tag combination");
701}
702
703/* #13705 */
704relation[type=multipolygon][building] > way {
705 set part_of_building_MP;
706}
707way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier][place!=plot]!.part_of_building_MP {
708 /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
709 throwOther: tr("possibly missing {0} tag", "{1.key}");
710 group: tr("missing tag");
711}
712
713/* see #8519, #11529, limited to motorways and trunks to avoid false positives for streets with lanes for non motorized traffic */
714way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/] {
715 set MotorwayTrunk;
716}
717way.MotorwayTrunk[lanes][turn:lanes ][tag(lanes)!=eval(count(split("|", tag("turn:lanes"))))],
718way.MotorwayTrunk[lanes][change:lanes ][tag(lanes)!=eval(count(split("|", tag("change:lanes"))))],
719way.MotorwayTrunk[lanes][maxspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("maxspeed:lanes"))))],
720way.MotorwayTrunk[lanes][minspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("minspeed:lanes"))))],
721way.MotorwayTrunk[lanes][destination:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:lanes"))))],
722way.MotorwayTrunk[lanes][destination:ref:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:ref:lanes"))))],
723way.MotorwayTrunk[lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
724 throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
725 group: tr("suspicious tag combination");
726}
727
728/* #14125, #14323, #18185 */
729way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][oneway!=reversible][highway!=motorway][junction!=roundabout][lanes>2][mod(tag(lanes),2)=1] {
730 throwWarning: tr("street with odd number of {0}, but without {1} and {2} or {3}", "{1.key}", "{2.key}", "{3.key}", "{4.key}");
731 group: tr("missing tag");
732 assertNoMatch: "way highway=primary lanes=2";
733 assertNoMatch: "way highway=primary lanes=3 lanes:backward=2";
734 assertNoMatch: "way highway=primary lanes=3 oneway=-1";
735 assertNoMatch: "way highway=primary lanes=4";
736 assertMatch: "way highway=primary lanes=3";
737}
738
739/* #10932, #19609 */
740way[/^.*:lanes$/][!lanes][highway][!source:lanes],
741way[/^.*:lanes:(forward|backward|both_ways)$/][!lanes][highway],
742way[/^.*:lanes:both_ways$/][!lanes:both_ways][highway] {
743 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
744 group: tr("missing tag");
745 assertMatch: "way highway=primary turn:lanes=left|right";
746 assertMatch: "way highway=primary turn:lanes:forward=left|right";
747 assertNoMatch: "way highway=primary turn:lanes=left|right lanes=2";
748}
749way[/^.*:lanes:forward$/][!lanes:forward][!lanes:backward][highway][mod(tag(lanes),2)=0],
750way[/^.*:lanes:backward$/][!lanes:backward][!lanes:forward][highway][mod(tag(lanes),2)=0] {
751 throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
752 group: tr("missing tag");
753 assertMatch: "way highway=primary turn:lanes:forward=left|right lanes=2";
754 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes:forward=2";
755 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes=3";
756}
757
758/* #15774 */
759node[emergency=fire_hydrant][fire_hydrant:count][fire_hydrant:count!=1] {
760 throwOther: tr("{0} together with {1}. Tag each hydrant separately.", "{0.tag}", "{1.tag}");
761}
762
763/* #12502 */
764node[leisure=park][natural=tree] {
765 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
766 group: tr("suspicious tag combination");
767 fixRemove: "leisure";
768}
769
770/* #17305 */
771area[boundary=administrative][landuse=residential] {
772 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
773 group: tr("suspicious tag combination");
774}
775
776/* #17391 */
777way[highway=pedestrian][width][width<3] {
778 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
779 suggestAlternative: "highway=footway";
780 group: tr("suspicious tag combination");
781 fixAdd: "highway=footway";
782 assertMatch: "way highway=pedestrian width=0.8";
783 assertMatch: "way highway=pedestrian width=1";
784 assertNoMatch: "way highway=pedestrian width=3";
785 assertNoMatch: "way highway=pedestrian width=5.5";
786}
787
788/* see #17623 */
789way:areaStyle[highway][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service$|living_street|pedestrian|track|path|footway|cycleway|busway|bus_guideway|bridleway/][area!=yes] {
790 throwOther: tr("A linear object {0} without {1} has a tag indicating that it is an area.", "{1.tag}", "{3.tag}");
791 group: tr("suspicious tag combination");
792}
793
794/* #17804 */
795area[cemetery=sector][landuse=cemetery] {
796 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
797 group: tr("suspicious tag combination");
798}
799
800/* #17967 */
801*[highway=cycleway][cycleway=track] {
802 throwWarning: tr("{0} together with {1}. Remove {1}.", "{0.tag}", "{1.tag}");
803 group: tr("suspicious tag combination");
804 fixRemove: "cycleway";
805}
806
807/* #17973, #18183, #18331, #20318 */
808way[highway=path ][!segregated][foot=designated][bicycle=designated],
809way[highway=footway ][!segregated][bicycle=designated],
810way[highway=cycleway][!segregated][foot=designated] {
811 throwWarning: tr("Combined foot- and cycleway without {0}.", "{1.key}");
812 group: tr("missing tag");
813}
814
815/* #17989 */
816node[emergency_ward_entrance][emergency!=emergency_ward_entrance] {
817 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
818 group: tr("missing tag");
819 fixAdd: "emergency=emergency_ward_entrance";
820}
821
822/* missing or conflicting construction, see #17607 */
823/* {0.key} without {1.key} and {2.key} */
824*[construction:building][!building][!construction],
825*[construction:highway][!highway][!construction],
826*[construction:railway][!railway][!construction],
827*[construction:landuse][!landuse][!construction] {
828 throwWarning: tr("{0} without {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
829 group: tr("missing tag");
830 fixAdd: "{1.key}=construction";
831 fixAdd: "construction={0.value}";
832 assertMatch: "way construction:building=house";
833 assertNoMatch: "way construction:building=house building=house ";
834 assertNoMatch: "way construction:building=house construction=house";
835}
836/* {0.key} and {1.key} without {2.key} */
837*[building=construction]["construction:building"][!construction],
838*[highway=construction]["construction:highway"][!construction],
839*[railway=construction]["construction:railway"][!construction],
840*[landuse=construction]["construction:landuse"][!construction] {
841 throwWarning: tr("{0} together with {1} but without {2}", "{0.key}", "{1.key}", "{2.key}");
842 group: tr("missing tag");
843 fixAdd: "construction={1.value}";
844 assertMatch: "way construction:building=house building=construction";
845 assertNoMatch: "way construction:building=house building=house ";
846 assertNoMatch: "way construction:building=house construction=house";
847}
848/* {0.key} and {1.key} without {2.key} */
849*[building]["construction:building"][!construction][building!=construction],
850*[highway]["construction:highway"][!construction][highway!=construction],
851*[railway]["construction:railway"][!construction][railway!=construction],
852*[landuse]["construction:landuse"][!construction][landuse!=construction] {
853 throwWarning: tr("{0} together with {1} and conflicting values plus no {2}", "{0.key}", "{1.key}", "{2.key}");
854 group: tr("suspicious tag combination");
855 assertMatch: "way construction:building=house building=office";
856 assertNoMatch: "way construction:building=house building=construction";
857 assertNoMatch: "way construction:building=house construction=house";
858}
859
860*["construction:building"][construction][construction:building != *construction],
861*["construction:highway"][construction][construction:highway != *construction],
862*["construction:railway"][construction][construction:railway != *construction],
863*["construction:landuse"][construction][construction:landuse != *construction] {
864 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
865 group: tr("suspicious tag combination");
866 assertMatch: "way construction:building=house construction=office";
867 assertNoMatch: "way construction:building=house construction=house";
868}
869
870/* #18203, #20960 */
871way[highway][construction][construction!~/^(yes|minor|no)$/][highway!=construction],
872way[railway][construction][construction!~/^(yes|minor|no)$/][railway!=construction],
873area[building][construction][construction!~/^(yes|minor|no)$/][building!=construction],
874area[landuse][construction][construction!~/^(yes|minor|no)$/][landuse!=construction] {
875 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
876 group: tr("suspicious tag combination");
877}
878
879/* #18374, #22295 */
880*[amenity=recycling][collection_times="24/7"][!opening_hours],
881*[amenity=recycling][collection_times ][!opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
882 throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
883 group: tr("suspicious tag combination");
884 fixChangeKey: "collection_times => opening_hours";
885 assertMatch: "node amenity=recycling collection_times=\"Mo-Fr 06:00-20:00\"";
886 assertNoMatch: "node amenity=recycling collection_times=\"Mo-Fr 15:00\"";
887 assertNoMatch: "node amenity=recycling collection_times=\"Mo 08:00-11:00\"";
888 assertNoMatch: "node amenity=recycling collection_times=\"Sa[2,4] 8:00-11:00\"";
889}
890
891/* #19018 */
892way[highway][crossing][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] {
893 throwWarning: tr("{0} together with {1}. Should be used on a minor highway type or a node", "{1.key}", "{0.tag}");
894 group: tr("suspicious tag combination");
895 fixRemove: "crossing";
896 assertMatch: "way highway=trunk crossing=unmarked";
897 assertNoMatch: "way highway=construction construction=footway crossing=unmarked";
898}
899
900/* #19066 */
901*[amenity=recycling][!/^recycling:/][recycling_type!=centre] {
902 throwWarning: tr("{0} without {1}", "{0.tag}", "recycling:*");
903 group: tr("missing tag");
904}
905*[source:addr][!/^addr:/] {
906 throwWarning: tr("{0} without {1}", "{0.key}", "addr:*");
907 group: tr("missing tag");
908 assertMatch: "node source:addr=postman";
909 assertNoMatch: "node source:addr=postman addr:housenumber=42";
910}
911*[source:maxspeed][!/^maxspeed:?/] {
912 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
913 group: tr("missing tag");
914}
915
916/* #16898, tower vs. communications_tower, wiki suggests 100m as rough guideline, so we warn for < 75m */
917*[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' */
918 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
919 suggestAlternative: "man_made=tower + tower:type=communication + height";
920 group: tr("suspicious tag combination");
921 assertMatch: "node man_made=communications_tower height=58";
922 assertMatch: "node man_made=communications_tower height=\"74 m\"";
923 assertMatch: "node man_made=communications_tower height=0.8";
924 assertMatch: "node man_made=communications_tower height=245'";
925 assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
926 assertMatch: "node man_made=communications_tower height=231'10.22\"";
927 assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
928 assertNoMatch: "node man_made=communications_tower height=75.72";
929 assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
930 assertNoMatch: "node man_made=communications_tower height=4358'8\"";
931 assertNoMatch: "node height=4358'";
932}
933
934/* #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. */
935*[fixme][count(split(" ", tag("fixme"))) == 1][has_tag_key(tag("fixme"))],
936*[FIXME][count(split(" ", tag("FIXME"))) == 1][has_tag_key(tag("FIXME"))] {
937 throwWarning: tr("{0} together with {1}. Is the fixme fixed?", "{0.tag}", "{0.value}");
938 group: tr("suspicious tag combination");
939 assertMatch: "way name=\"Florist Gump\" fixme=name";
940 assertMatch: "way name=\"Florist Gump\" FIXME=name";
941 assertNoMatch: "way fixme=name";
942 assertNoMatch: "way name=\"Florist Gump\"";
943 assertNoMatch: "way name=\"Florist Gump\" fixme=\"the name might have changed\"";
944}
945
946/* #19094 */
947way[highway][placement=transition][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition],
948way[highway][!placement][/^placement:.*$/][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition] {
949 throwWarning: tr("Use {0} only as value of {1}", "transition", "placement");
950 set PlacementTransitionWarning;
951 fixAdd: "placement=transition";
952 fixRemove: "placement:forward";
953 fixRemove: "placement:backward";
954 fixRemove: "placement:both_ways";
955 assertMatch: "way highway=primary placement=transition placement:both_ways=transition";
956 assertMatch: "way highway=primary placement:backward=transition placement:forward=transition";
957 assertNoMatch: "way highway=primary placement:backward=middle_of:1 placement:forward=transition";
958 assertNoMatch: "way highway=primary placement=middle_of:1 placement:backward=transition placement:forward=transition";
959}
960way[placement][/^placement:.*$/][highway]!.PlacementTransitionWarning,
961way["placement:forward"]["placement:backward"][highway]!.PlacementTransitionWarning,
962way["placement:forward"]["placement:both_ways"][highway]!.PlacementTransitionWarning,
963way["placement:backward"]["placement:both_ways"][highway]!.PlacementTransitionWarning {
964 throwError: tr("{0} together with {1}", "{0.key}", "{1.key}");
965 group: tr("suspicious tag combination");
966 assertMatch: "way highway=primary placement=left_of:2 placement:forward=right_of:1";
967 assertNoMatch: "way highway=primary placement:forward=right_of:1";
968 assertNoMatch: "way highway=primary placement:forward=transition placement:both_ways=transition";
969}
970
971/* #19742 */
972node:righthandtraffic[highway=mini_roundabout][direction=clockwise] {
973 throwWarning: tr("{0} together with {1} at right-hand traffic", "{1.tag}", "{2.tag}");
974 group: tr("suspicious tag combination");
975}
976node!:righthandtraffic[highway=mini_roundabout][direction=anticlockwise] {
977 throwWarning: tr("{0} together with {1} at left-hand traffic", "{1.tag}", "{2.tag}");
978 group: tr("suspicious tag combination");
979}
980
981/* #19603 */
982way[footway][highway][footway=sidewalk ][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
983 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
984 group: tr("suspicious tag combination");
985 suggestAlternative: "sidewalk=left";
986 suggestAlternative: "sidewalk=right";
987 suggestAlternative: "sidewalk=both";
988 suggestAlternative: "sidewalk=separate";
989}
990way[footway][highway][footway!=sidewalk][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
991 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
992 group: tr("suspicious tag combination");
993}
994way[footway][!highway][!/:highway$/],
995way[cycleway][!highway][!/:highway$/] {
996 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
997 group: tr("missing tag");
998 assertNoMatch: "way footway=sidewalk abandoned:highway=unclassified";
999}
1000
1001/* #17498 */
1002way[bicycle][/^cycleway(:|$)/][!/^bicycle:/][bicycle=~/^(no|use_sidepath)$/][/^cycleway(:|$)/!~/^(no|none|separate)$/] {
1003 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
1004 group: tr("suspicious tag combination");
1005 assertMatch: "way bicycle=no cycleway=track";
1006 assertMatch: "way bicycle=use_sidepath cycleway=lane";
1007 assertMatch: "way bicycle=use_sidepath cycleway:left=lane";
1008 assertNoMatch: "way bicycle=use_sidepath cycleway=no";
1009 assertNoMatch: "way bicycle=use_sidepath bicycle:backward=yes cycleway:left=lane"; /* instead of :backward, could also be :forward or :conditional */
1010 assertNoMatch: "way bicycle=no cycleway:right=no";
1011 assertNoMatch: "way bicycle=use_sidepath cycleway:left=none";
1012 assertNoMatch: "way highway=cycleway cycleway=separate";
1013 assertNoMatch: "way highway=residential bicycle=use_sidepath";
1014}
1015
1016/* #19980 */
1017way[highway=living_street][maxspeed][maxspeed=~/mph/][get(split(" ", tag(maxspeed)), 0) > 15],
1018way[highway=living_street][maxspeed][maxspeed!~/mph/][get(split(" ", tag(maxspeed)), 0) > 20] {
1019 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
1020 group: tr("suspicious tag combination");
1021 assertNoMatch: "way highway=living_street";
1022 assertNoMatch: "way highway=living_street maxspeed=20";
1023 assertNoMatch: "way highway=living_street maxspeed=\"15 mph\"";
1024 assertNoMatch: "way highway=living_street maxspeed=walk";
1025 assertMatch: "way highway=living_street maxspeed=30";
1026 assertMatch: "way highway=living_street maxspeed=\"20 mph\"";
1027}
1028
1029/* piste subtags, see #17606 */
1030way[piste:type=nordic][!piste:grooming] {
1031 throwWarning: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1032 group: tr("missing tag");
1033 assertMatch: "way piste:type=nordic";
1034 assertNoMatch: "way piste:type=nordic piste:grooming=classic";
1035}
1036
1037way[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty][count(parent_tags("piste:difficulty")) == 0] {
1038 set missing_parent_piste_difficulty;
1039}
1040way.missing_parent_piste_difficulty:new,
1041way.missing_parent_piste_difficulty:in-downloaded-area!:new {
1042 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1043 group: tr("missing tag");
1044 set missing_piste_difficulty;
1045 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1046}
1047relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] >
1048 way[!piste:difficulty]!.missing_piste_difficulty {
1049 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1050 group: tr("missing tag");
1051 set missing_piste_difficulty_both;
1052 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1053}
1054way[piste:type=nordic][!piste:difficulty]!.missing_piste_difficulty!.missing_piste_difficulty_both {
1055 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1056 group: tr("missing tag");
1057 assertMatch: "way piste:type=nordic";
1058 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1059}
1060
1061relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] {
1062 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1063 group: tr("missing tag");
1064 assertMatch: "relation piste:type=nordic";
1065 assertNoMatch: "relation piste:type=nordic piste:difficulty=easy";
1066}
1067relation[piste:type=nordic][!piste:grooming]{
1068 throwOther: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1069 group: tr("missing tag");
1070 assertMatch: "relation piste:type=nordic";
1071 assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
1072}
1073
1074/* #21836 */
1075*[voltage:primary][voltage:secondary][transformer=generator][tag("voltage:secondary")<tag("voltage:primary")] {
1076 throwWarning: tr("{0} is lower than {1} on {2}.", "{1.key}", "{0.key}", "{2.tag}");
1077 group: tr("suspicious tag combination");
1078}
Note: See TracBrowser for help on using the repository browser.