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

Last change on this file since 18230 was 18230, checked in by Don-vip, 4 months ago

fix #20530 - fix #20531 - Add man_made pump preset, deprecate man_made=pumping_rig, pump:type=* and substance=heat (patch and icons by skyper, François Lacombe and gaben)

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