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

Last change on this file since 16769 was 16769, checked in by Klumbumbus, 2 months ago

fix #10932 - Warn about ways with *:lanes but without lanes (also with :forward, :backward and :both_ways extensions) (patch by skyper, modified)

  • Property svn:eol-style set to native
File size: 36.4 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[lanes                      ][!highway][leisure!=track][leisure!=swimming_pool],
12way[living_street              ][!highway],
13way[maintenance                ][!highway],
14way[median                     ][!highway],
15way[motorroad                  ][!highway],
16node[ntd_id                    ][!highway],
17way[sac_scale                  ][!highway],
18way[sidewalk                   ][!highway],
19way[step_count                 ][!highway][man_made!=tower],
20way[tracktype                  ][!highway],
21way[trail_visibility           ][!highway], /* #15029 */
22way[trolley_wire               ][!highway],
23way[zip_left                   ][!highway],
24way[zip_right                  ][!highway],
25way[detail                     ][!railway][route!=railway],
26way[eddy_current_brake         ][!railway][route!=railway],
27way[electrified                ][!railway][route!=railway][!highway], /* #16007 */
28way[etcs                       ][!railway][route!=railway],
29way[gauge                      ][!railway][route!=railway],
30way[grade_of_track             ][!railway][route!=railway],
31way[kursbuchstrecke            ][!railway][route!=railway],
32way[lzb                        ][!railway][route!=railway],
33way[old_railway_operator       ][!railway][route!=railway],
34way[operating_procedure        ][!railway][route!=railway],
35way[pzb                        ][!railway][route!=railway],
36way[structure_gauge            ][!railway][route!=railway],
37way[tilting_technology         ][!railway][route!=railway],
38way[track_class                ][!railway][route!=railway],
39way[tracks                     ][!railway][route!=railway],
40way[traffic_mode               ][!railway][route!=railway],
41way[workrules                  ][!railway][route!=railway],
42way[length_unit                ][!waterway],
43way[canal                      ][!waterway],
44way[have_riverbank             ][!waterway],
45*[border_type                  ][!boundary],
46*[piste:difficulty             ][!piste:type],
47*[place                        ][!name][place!=islet],
48*[transformer                  ][!power],
49*[source:date                  ][!source],
50*[source:name                  ][!name][noname!=yes],
51*[source:maxspeed:forward      ][!maxspeed:forward][!maxspeed],
52*[source:maxspeed:backward     ][!maxspeed:backward][!maxspeed],
53*[source:building              ][!building],
54*[source:ref                   ][!ref][noref!=yes],
55*[source:population            ][!population],
56*[source:postal_code           ][!postal_code],
57*[source:ele                   ][!ele],
58*[source:ref:INSEE             ][!ref:INSEE],
59*[source:lit                   ][!lit],
60*[source:hgv                   ][!hgv],
61*[source:highway               ][!highway],
62*[source:maxaxleload           ][!maxaxleload],
63*[source:surface               ][!surface],
64*[source:bridge                ][!bridge],
65*[source:old_name              ][!old_name],
66*[source:bicycle               ][!bicycle],
67*[source:designation           ][!designation],
68*[source:height                ][!height],
69*[source:lanes                 ][!lanes],
70*[source:postcode              ][!addr:postcode],
71*[source:housenumber           ][!addr:housenumber],
72*[source:addr:postcode         ][!addr:postcode],
73*[source:addr:housenumber      ][!addr:housenumber] {
74  throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
75  set MissingKeyWarning;
76  group: tr("missing tag");
77  assertMatch: "way lanes=42";
78  assertNoMatch: "way lanes=42 highway=unclassified";
79  assertMatch: "node source:addr:postcode=postman";
80}
81
82/* {0.key} without {1.key} (info level) */
83way[lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1],
84way[lanes:backward][!lanes:forward][oneway!=yes][oneway!=-1],
85*[leaf_type ][!leaf_cycle],
86*[leaf_cycle][!leaf_type] {
87  throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
88  group: tr("missing tag");
89}
90
91/* {0.key} without {1.tag}, #17997 */
92node[railway:switch            ][railway!=switch],
93*[generator:source             ][power!=generator],
94*[generator:method             ][power!=generator],
95*[generator:type               ][power!=generator],
96node[fire_hydrant:type         ][emergency!=fire_hydrant][disused:emergency!=fire_hydrant],
97node[manhole                   ][man_made!=manhole],
98way[fence_type                 ][barrier!=fence],
99*[recycling_type               ][amenity!=recycling],
100*[information                  ][tourism!=information],
101node[board_type                ][information!=board],
102*[shelter_type                 ][amenity!=shelter],
103node[lamp_type                 ][highway!=street_lamp],
104node[map_type                  ][information!=map],
105*[site_type                    ][historic!=archaeological_site],
106*[artwork_type                 ][tourism!=artwork][exhibit!=artwork],
107*[castle_type                  ][historic!=castle],
108*[parking                      ][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/][parking!=yes][parking!=no],
109way[cutline                    ][man_made!=cutline],
110*[bunker_type                  ][military!=bunker] {
111  throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
112  group: tr("missing tag");
113}
114
115/* {0.key} without {1.tag} or {2.tag}, #15107 */
116*[iata                         ][aeroway!=aerodrome][aeroway!=helipad],
117*[icao                         ][aeroway!=aerodrome][aeroway!=helipad],
118*[bridge:movable               ][bridge!=movable][man_made!=bridge],
119*[substation                   ][power!=substation][pipeline!=substation],
120*[reservoir_type               ][landuse!=reservoir][water!=reservoir],
121way[waterway=pressurised       ][tunnel!=flooded][man_made!=pipeline] {
122  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.tag}", "{2.tag}");
123  group: tr("missing tag");
124}
125
126/* {0.tag} without {1.key} (warning level), #18411, #18246 */
127way[railway=construction][!construction],
128way[highway=construction][!construction],
129node[traffic_sign=maxspeed][!maxspeed],
130node[actuator=manual][!handle],
131node[emergency=fire_hydrant][!fire_hydrant:type],
132way[     boundary=administrative][!admin_level],
133relation[boundary=administrative][!admin_level],
134relation[route=bicycle ][!network][type=route],
135relation[route=hiking  ][!network][type=route],
136relation[route=foot    ][!network][type=route],
137relation[route=horse   ][!network][type=route],
138relation[route=piste][!piste:type][type=route],
139relation[route=ski  ][!piste:type][type=route],
140*[tourism=information][!information],
141*[leisure=pitch][!sport],
142*[aeroway=terminal][!building],
143*[office=government][!government],
144*[power=generator][!generator:source],
145*[amenity=social_facility][!social_facility],
146*[amenity=place_of_worship][!religion],
147*[man_made=tower][!tower:type] {
148  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
149  group: tr("missing tag");
150}
151
152/* {0.tag} without {1.key} (info level), #15107 */
153*[aeroway=runway               ][!ref],
154*[aeroway=runway               ][!surface],
155node[highway=crossing          ][!crossing],
156way[highway=track              ][!tracktype],
157way[power=cable                ][!location],
158node[power=transformer         ][!voltage:primary],
159node[power=transformer         ][!voltage:secondary],
160node[transformer=distribution  ][!voltage:primary][power=pole],
161node[transformer=distribution  ][!voltage:secondary][power=pole],
162way[power=line                 ][!voltage],
163way[power=minor_line           ][!voltage],
164way[power=cable                ][!voltage],
165*[power=generator              ][!voltage][generator:output:electricity],
166*[power=plant                  ][!voltage][plant:output:electricity],
167*[power=substation             ][!substation],
168*[power=switch                 ][!switch],
169*[power=transformer            ][!transformer],
170*[amenity=bank                 ][!operator],
171*[amenity=cinema               ][!operator],
172*[amenity=fast_food            ][!operator],
173*[amenity=fuel                 ][!operator],
174*[mountain_pass=yes            ][!ele],
175*[natural=peak                 ][!ele],
176*[natural=water                ][!water],
177*[amenity=place_of_worship     ][!denomination],
178*[amenity=parking              ][!parking],
179*[amenity=parking_entrance     ][!parking] {
180  throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
181  group: tr("missing tag");
182  assertMatch: "way power=line";
183  assertNoMatch: "way power=line voltage=1";
184  assertMatch: "way power=switch";
185  assertMatch: "way power=substation";
186  assertMatch: "way power=substation transformer=foobar";
187  assertNoMatch: "way power=substation substation=foobar";
188  assertMatch: "way power=generator generator:output:electricity=yes";
189  assertNoMatch: "way power=generator";
190  assertNoMatch: "way power=generator generator:output:electricity=yes voltage=1";
191}
192
193/* {0.key} without {1.key} or {2.tag} */
194way[bridge:structure           ][!bridge][man_made!=bridge],
195*[smoothness                   ][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/],
196*[segregated                   ][!highway][railway!=crossing] {
197  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
198  group: tr("missing tag");
199}
200
201/* {0.tag} without {1.tag} (info level) see #11600 #11393 #11850 */
202way[highway=motorway][!oneway][junction!=roundabout],
203way[highway=motorway_link][!oneway][junction!=roundabout] {
204  throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
205  group: tr("missing tag");
206}
207
208/* {0.tag} without {1.tag} */
209way[usage=penstock][man_made!=pipeline],
210way[usage=penstock][waterway!=pressurised] {
211  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
212  group: tr("missing tag");
213}
214
215/* {0.tag} without {1.tag} or {2.tag} */
216*[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
217  throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
218  group: tr("missing tag");
219}
220
221/* {0.key} without {1.key}, {2.tag} or {3.tag} */
222*[intermittent                 ][!waterway][natural!~/^(water|spring)$/][landuse!~/^(basin|reservoir)$/][ford!=yes],
223*[boat                         ][!waterway][natural!=water             ][landuse!~/^(basin|reservoir)$/][ford!=yes] {
224  throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
225  group: tr("missing tag");
226}
227
228/* {0.key} without {1.key}, {2.key} or {3.key}, #17253 */
229way[oneway   ][!highway][!railway][!aerialway][attraction!=summer_toboggan][aeroway!~/^(runway|taxiway)$/],
230*[snowplowing][!highway][!amenity][!leisure] {
231  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
232  group: tr("missing tag");
233}
234
235/* {0.key} without {1.key}, {2.key} or {3.tag}, #17255 */
236way[incline                    ][!highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan],
237*[toll                         ][!highway][!barrier][route!~/^(ferry|road)$/] {
238  throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
239  group: tr("missing tag");
240}
241
242/* {0.tag} together with {1.key}, see #17664, #17707, #16464, #10837, #14034, #9389, #11977, #13156, #16888 */
243*[power=plant][/^generator:/],
244*[power=generator][/^plant:/],
245*[power=plant][voltage],
246*[power=plant][frequency],
247*[internet_access=no][internet_access:fee],
248node[power=transformer][voltage],
249node[transformer=distribution][voltage][power=pole],
250*[amenity=vending_machine][shop],
251*[noname?][name],
252way[oneway=yes][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no],
253way[oneway=yes][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][oneway:bicycle!=no][oneway:psv!=no],
254way[oneway=-1 ][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no],
255way[oneway=-1 ][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][oneway:bicycle!=no][oneway:psv!=no] {
256  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
257  group: tr("suspicious tag combination");
258  assertMatch: "way power=plant generator:source=wind";
259  assertMatch: "way power=generator plant:source=combustion";
260}
261
262/* {0.tag} together with {1.tag} (info level), see #9696 */
263way[highway=footway][oneway=no] {
264  throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
265  group: tr("suspicious tag combination");
266}
267
268/* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186 */
269*[barrier=kerb][kerb=no],
270way[highway=construction][construction=yes],
271way[railway=construction][construction=yes],
272*[man_made=bridge][bridge=yes],
273*[man_made=tunnel][tunnel=yes],
274*[amenity=police][police],
275node[highway=crossing][crossing=no],
276node[railway=crossing][crossing=no],
277way[junction=yes][highway],
278way[tracktype=grade1][surface].unpaved_surface,
279way[tracktype=grade2][surface][surface=~/^(sand|mud)$/],
280way[segregated][bicycle=no],
281way[segregated][foot=no],
282way[man_made=pipeline][tunnel=flooded],
283way[waterway=canal][tunnel=yes] {
284  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
285  group: tr("suspicious tag combination");
286}
287
288/* {0.tag} together with {1.tag} (error level) */
289relation[type=multipolygon][area=no] {
290  throwError: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
291  group: tr("suspicious tag combination");
292}
293
294/* {0.key} together with {1.key}, #18267, #17630, #17604 */
295node[marker][cover],
296node[marker][voltage],
297node[marker][pressure],
298node[marker][diameter],
299node[marker][substance],
300*[building:part][building],
301*[addr:street][addr:place][outside("CZ,DK")] {
302  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
303  group: tr("suspicious tag combination");
304}
305
306/* {0.tag} together with {1.tag} and {2.key}, #18471 */
307way[highway=~/^(cycleway|footway|path)$/][segregated=no][sidewalk =~/^(left|right|both)$/] {
308  throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.tag}", "{2.key}");
309  group: tr("suspicious tag combination");
310}
311
312/* #11127, #13727 */
313way[waterway][bridge=yes][waterway!=weir] {
314  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
315  suggestAlternative: "bridge=aqueduct";
316  group: tr("suspicious tag combination");
317  fixAdd: "bridge=aqueduct";
318}
319way[waterway=weir][bridge=yes][highway] {
320  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
321  suggestAlternative: "waterway=weir + ford=yes";
322  suggestAlternative: "waterway=dam";
323  suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
324  group: tr("suspicious tag combination");
325}
326
327/* #16214 */
328relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
329  throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
330  fixRemove: "area";
331  set area_yes_autofix;
332  group: tr("suspicious tag combination");
333}
334
335/* only {0.key}, see #11104 #12422 #14950 */
336*[access][eval(number_of_tags()) = 1],
337*[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
338*[name][eval(number_of_tags()) = 1],
339*[ref][eval(number_of_tags()) = 1],
340*[lit][eval(number_of_tags()) = 1] {
341  throwWarning: tr("incomplete object: only {0}", "{0.key}");
342  group: tr("missing tag");
343}
344/* only {0.key} and {1.key} */
345*[name][area][eval(number_of_tags()) = 2],
346*[name][ref][eval(number_of_tags()) = 2] {
347  throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
348  group: tr("missing tag");
349}
350/* only {0.tag}, #15269 */
351*[tourism=attraction][eval(number_of_tags()) = 1] {
352  throwWarning: tr("incomplete object: only {0}", "{0.tag}");
353  group: tr("missing tag");
354}
355/* only {0.key} and {1.tag} */
356*[name][tourism=attraction][eval(number_of_tags()) = 2] {
357  throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
358  group: tr("missing tag");
359}
360
361/* #9811, #11491, #12865, #14310 */
362*[place][place!=farm][/^(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)$/],
363/* addr:postcode is used together with place in some countries */
364*[boundary][/^addr:/],
365*[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
366  throwWarning: tr("{0} together with {1}", "{0.key}", "addr:*");
367  group: tr("suspicious tag combination");
368  assertMatch: "node place=foo addr:housenumber=5";
369  assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
370  assertNoMatch: "node place=foo  addr:postcode=12345";
371}
372*[!highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
373  throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
374  group: tr("suspicious tag combination");
375}
376*[!highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
377  throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
378  group: tr("suspicious tag combination");
379}
380way[highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
381  throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
382  group: tr("suspicious tag combination");
383  fixRemove: "addr:postcode";
384}
385way[highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
386  throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
387  group: tr("suspicious tag combination");
388}
389way[highway][highway!=services][highway!=rest_area][!postal_code]["addr:postcode"] {
390  throwWarning: tr("{0} together with {1}", "{0.key}", "{4.key}");
391  suggestAlternative: "postal_code";
392  group: tr("suspicious tag combination");
393  fixChangeKey: "addr:postcode=>postal_code";
394}
395
396/* #9195 */
397way[highway=footway][cycleway=lane] {
398  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
399  suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
400  group: tr("suspicious tag combination");
401}
402
403/* {0} on suspicious object */
404*[tunnel  ][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=tunnel],
405*[bridge  ][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=bridge][building!=bridge],
406*[psv     ][!highway][!railway][!waterway][barrier!=bollard][amenity !~ /^parking.*/],
407*[width   ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track],
408*[maxspeed][!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 !~ /^(river|canal|lock)$/][!traffic_calming][aerialway!=zip_line] {
409  throwWarning: tr("{0} on suspicious object", "{0.key}");
410  group: tr("suspicious tag combination");
411}
412
413*[amenity][amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][!name][noname!=yes] {
414  throwOther: tr("{0} without {1}", "{0.tag}", "{2.key}");
415  group: tr("missing tag");
416  assertMatch: "node amenity=restaurant";
417  assertNoMatch: "node amenity=restaurant noname=yes";
418  assertNoMatch: "node amenity=restaurant name=Foobar";
419}
420
421/* #10193, #16157 */
422way[highway][barrier],
423*[highway][waterway][waterway!=dam][waterway!=weir],
424way[highway][natural][natural!=ridge],
425*[landuse][building][landuse!=retail] {
426  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
427  group: tr("suspicious tag combination");
428  assertNoMatch: "node highway=street_lamp natural=birds_nest";
429}
430
431/* #6932 */
432*[natural=water][leisure=swimming_pool] {
433  throwWarning: tr("natural water used for swimming pool");
434  group: tr("suspicious tag combination");
435  fixRemove: "natural";
436}
437
438/* #9593, #11183, #12418, #12761, #17254, #19311  */
439*[sport][sport!=skiing][!building][!club][tourism != hotel][highway != raceway][!leisure][natural !~ /^(beach|bare_rock|cliff|peak|water)$/][amenity !~ /^(dojo|pub|restaurant|swimming_pool)$/][landuse !~ /^(recreation_ground|piste|farm|farmland)$/][barrier !~ /^(wall|retaining_wall)$/][!"piste:type"][shop!=sports][attraction!=summer_toboggan] {
440    throwWarning: tr("sport without physical feature");
441    group: tr("missing tag");
442    assertMatch: "node sport=tennis";
443    assertNoMatch: "node sport=tennis leisure=pitch";
444    assertNoMatch: "node sport=beachvolleyball natural=beach";
445    assertNoMatch: "node sport=skiing"; /* skiing has deprecated warning */
446    assertNoMatch: "node sport=swimming tourism=hotel";
447    assertNoMatch: "node sport=10pin amenity=restaurant";
448}
449
450/* {0.key} without {1.key} or {2.key} see #10140 */
451*[building:levels][!building][!building:part],
452way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] {
453  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
454  group: tr("missing tag");
455}
456
457/* any other *_name tag (with some exceptions) but not a name , see #10837 #11297 #11539 #16437 #17026 */
458*[/_name$/][!name][!old_name][!loc_name][!reg_name][!uic_name][!artist_name][!lock_name][!"osak:municipality_name"][!"osak:street_name"][noname!=yes] {
459  throwWarning: tr("alternative name without {0}", "{1.key}");
460  group: tr("missing tag");
461}
462
463/* #10837 */
464way[destination][!oneway?][junction!=roundabout][highway] {
465  throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
466  suggestAlternative: "destination:forward";
467  suggestAlternative: "destination:backward";
468}
469
470/* #11389, #19010 */
471way["maxspeed:forward"=*"maxspeed:backward"][!maxspeed] {
472  throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
473  suggestAlternative: "maxspeed";
474  group: tr("suspicious tag combination");
475  fixChangeKey: "maxspeed:forward=>maxspeed";
476  fixRemove: "maxspeed:backward";
477}
478way["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed][maxspeed] {
479  throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
480  set AllSameMaxspeed;
481  suggestAlternative: "maxspeed";
482  group: tr("suspicious tag combination");
483  fixRemove: "maxspeed:forward";
484  fixRemove: "maxspeed:backward";
485}
486way["cycleway:left"=*"cycleway:right"][!cycleway] {
487  throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
488  suggestAlternative: "cycleway";
489  group: tr("suspicious tag combination");
490  fixChangeKey: "cycleway:left=>cycleway";
491  fixRemove: "cycleway:right";
492}
493way["cycleway:left"=*cycleway]["cycleway:right"=*cycleway][cycleway] {
494  throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
495  set AllSameCycleway;
496  suggestAlternative: "cycleway";
497  group: tr("suspicious tag combination");
498  fixRemove: "cycleway:left";
499  fixRemove: "cycleway:right";
500}
501way["sidewalk:left"=*"sidewalk:right"][!sidewalk] {
502  throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
503  suggestAlternative: "sidewalk";
504  group: tr("suspicious tag combination");
505  fixChangeKey: "sidewalk:left=>sidewalk";
506  fixRemove: "sidewalk:right";
507}
508way["sidewalk:left"=*sidewalk]["sidewalk:right"=*sidewalk][sidewalk] {
509  throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
510  set AllSameSidewalk;
511  suggestAlternative: "sidewalk";
512  group: tr("suspicious tag combination");
513  fixRemove: "sidewalk:left";
514  fixRemove: "sidewalk:right";
515}
516way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed,
517way["cycleway:left"]["cycleway:right"][cycleway]!.AllSameCycleway,
518way["sidewalk:left"]["sidewalk:right"][sidewalk]!.AllSameSidewalk {
519  throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
520  group: tr("suspicious tag combination");
521}
522way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
523way["maxspeed:backward"][maxspeed][!"maxspeed:forward"],
524way["cycleway:left"][cycleway][!"cycleway:right"],
525way["cycleway:right"][cycleway][!"cycleway:left"],
526way["sidewalk:left"][sidewalk][!"sidewalk:right"],
527way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
528  throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
529  group: tr("suspicious tag combination");
530}
531
532/* #11837 */
533way[layer][layer<0][bridge][bridge!=no][location!=underground][indoor!=yes][!tunnel],
534way[layer][layer>0][tunnel][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
535  throwWarning: tr("{0} together with {1}", "{2.tag}", "{0.tag}");
536  group: tr("suspicious tag combination");
537}
538
539/* #12942 */
540relation[oneway][type!=route] {
541  throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
542}
543
544/* #9182 */
545way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
546  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}");
547  group: tr("suspicious tag combination");
548}
549way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
550  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}");
551  group: tr("suspicious tag combination");
552}
553
554/* #13144, #15536 */
555*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
556*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
557  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
558  group: tr("suspicious tag combination");
559}
560*[unisex=yes][female=yes][male=yes][shop=hairdresser] {
561  throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
562  group: tr("suspicious tag combination");
563  fixRemove: "female";
564  fixRemove: "male";
565}
566*[female=yes][male=yes][!unisex][shop=hairdresser] {
567  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
568  suggestAlternative: "unisex=yes";
569  group: tr("suspicious tag combination");
570  fixRemove: "female";
571  fixRemove: "male";
572  fixAdd: "unisex=yes";
573}
574
575/* {1.key} without {2.tag} see #13138, #14468 */
576way!:closed[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir], /* water=intermittent is deprecated and has an own warning */
577area:closed[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir] {
578  throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
579  group: tr("missing tag");
580}
581
582/* #13680 */
583area[golf=bunker][natural=beach] {
584  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
585  suggestAlternative: "natural=sand";
586  suggestAlternative: "surface=sand";
587  group: tr("suspicious tag combination");
588}
589
590/* #13705 */
591relation[type=multipolygon][building] > way {
592  set part_of_building_MP;
593}
594way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier]!.part_of_building_MP {
595  /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
596  throwOther: tr("possibly missing {0} tag", "{1.key}");
597  group: tr("missing tag");
598}
599
600/* see #8519, #11529, limited to motorways and trunks to avoid false positives for streets with lanes for non motorized traffic */
601way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][turn:lanes              ][tag(lanes)!=eval(count(split("|", tag("turn:lanes"))))],
602way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][change:lanes            ][tag(lanes)!=eval(count(split("|", tag("change:lanes"))))],
603way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][maxspeed:lanes          ][tag(lanes)!=eval(count(split("|", tag("maxspeed:lanes"))))],
604way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][minspeed:lanes          ][tag(lanes)!=eval(count(split("|", tag("minspeed:lanes"))))],
605way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:lanes       ][tag(lanes)!=eval(count(split("|", tag("destination:lanes"))))],
606way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:ref:lanes   ][tag(lanes)!=eval(count(split("|", tag("destination:ref:lanes"))))],
607way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
608    throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
609    group: tr("suspicious tag combination");
610}
611
612/* #14125, #14323, #18185 */
613way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][oneway!=reversible][junction!=roundabout][lanes>2][get(split(".", tag(lanes)/2), 1)=5] {
614  throwWarning: tr("street with odd number of {0}, but without {1} and {2} or {3}", "{1.key}", "{2.key}", "{3.key}", "{4.key}");
615  group: tr("missing tag");
616  assertNoMatch: "way highway=primary lanes=2";
617  assertNoMatch: "way highway=primary lanes=3 lanes:backward=2";
618  assertNoMatch: "way highway=primary lanes=3 oneway=-1";
619  assertNoMatch: "way highway=primary lanes=4";
620  assertMatch: "way highway=primary lanes=3";
621}
622
623/* #10932 */
624way[highway][!lanes][/^.*:lanes$/]!.MissingKeyWarning, 
625way[highway][!lanes:forward][/^.*:lanes:forward$/], 
626way[highway][!lanes:backward][/^.*:lanes:backward$/],
627way[highway][!lanes:both_ways][/^.*:lanes:both_ways$/] {
628  throwWarning: tr("{0} without {1}", "{2.key}", "{1.key}");
629  group: tr("missing tag");
630  assertMatch: "way highway=primary turn:lanes=left|right";
631  assertNoMatch: "way highway=primary turn:lanes=left|right lanes=2";
632  assertMatch: "way highway=primary turn:lanes:forward=left|right";
633  assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes:forward=2";
634}
635
636/* #15774 */
637node[emergency=fire_hydrant][fire_hydrant:count][fire_hydrant:count!=1] {
638  throwOther: tr("{0} together with {1}. Tag each hydrant separately.", "{0.tag}", "{1.tag}");
639}
640
641/* #12502 */
642node[leisure=park][natural=tree] {
643  throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
644  group: tr("suspicious tag combination");
645  fixRemove: "leisure";
646}
647
648/* #17305 */
649area[boundary=administrative][landuse=residential] {
650  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
651  group: tr("suspicious tag combination");
652}
653
654/* #17391 */
655way[highway=pedestrian][width][width<3] {
656  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
657  suggestAlternative: "highway=footway";
658  group: tr("suspicious tag combination");
659  fixAdd: "highway=footway";
660  assertMatch: "way highway=pedestrian width=0.8";
661  assertMatch: "way highway=pedestrian width=1";
662  assertNoMatch: "way highway=pedestrian width=3";
663  assertNoMatch: "way highway=pedestrian width=5.5";
664}
665
666/* see #17623 */
667way:areaStyle[highway][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service$|living_street|pedestrian|track|path|footway|cycleway|bus_guideway|bridleway/][area!=yes] {
668  throwOther: tr("A linear object {0} without {1} has a tag indicating that it is an area.", "{1.tag}", "{3.tag}");
669  group: tr("suspicious tag combination");
670}
671
672/* #17804 */
673area[cemetery=sector][landuse=cemetery] {
674  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
675  group: tr("suspicious tag combination");
676}
677
678/* #17967 */
679*[highway=cycleway][cycleway=track] {
680  throwWarning: tr("{0} together with {1}. Remove {1}.", "{0.tag}", "{1.tag}");
681  group: tr("suspicious tag combination");
682  fixRemove: "cycleway";
683}
684
685/* #17973, #18183, #18331 */
686way[highway=path    ][foot][foot!=no      ][foot!=use_sidepath   ][!segregated][bicycle][bicycle!=no][bicycle!=use_sidepath][bicycle!=dismount]!.unpaved_surface,
687way[highway=footway ][bicycle][bicycle!=no][bicycle!=use_sidepath][!segregated][bicycle!=dismount]!.unpaved_surface,
688way[highway=cycleway][foot][foot!=no      ][foot!=use_sidepath   ][!segregated]!.unpaved_surface {
689  throwWarning: tr("Combined foot- and cycleway without {0}.", "{4.key}");
690  group: tr("missing tag");
691}
692
693/* #17989 */
694node[emergency_ward_entrance][emergency!=emergency_ward_entrance] {
695  throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
696  group: tr("missing tag");
697  fixAdd: "emergency=emergency_ward_entrance";
698}
699
700/* #18203 */
701way[construction][construction!=yes][construction!=minor][highway][highway!=construction] {
702  throwWarning: tr("{0} together with {1}", "{3.tag}", "{0.tag}");
703  group: tr("suspicious tag combination");
704}
705
706/* #18374 */
707*[amenity=recycling][collection_times="24/7"][!opening_hours],
708*[amenity=recycling][collection_times       ][!opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
709  throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
710  group: tr("suspicious tag combination");
711  fixChangeKey: "collection_times => opening_hours";
712  assertMatch: "node amenity=recycling collection_times=\"Mo-Fr 06:00-20:00\"";
713  assertNoMatch: "node amenity=recycling collection_times=\"Mo-Fr 15:00\"";
714  assertNoMatch: "node amenity=recycling collection_times=\"Mo 08:00-11:00\"";
715  assertNoMatch: "node amenity=recycling collection_times=\"Sa[2,4] 8:00-11:00\"";
716}
717*[amenity=recycling][collection_times="24/7"][opening_hours],
718*[amenity=recycling][collection_times       ][opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
719  throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
720  group: tr("suspicious tag combination");
721}
722
723/* #19018 */
724way[highway][crossing][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] {
725  throwWarning: tr("{0} together with {1}. Should be used on a minor highway type or a node", "{1.key}", "{0.tag}");
726  group: tr("suspicious tag combination");
727  fixRemove: "crossing";
728  assertMatch: "way highway=trunk crossing=unmarked";
729  assertNoMatch: "way highway=construction construction=footway crossing=unmarked";
730}
731
732/* #19066 */
733*[amenity=recycling][!/^recycling:/][recycling_type!=centre] {
734  throwWarning: tr("{0} without {1}", "{0.tag}", "recycling:*");
735  group: tr("missing tag");
736}
737*[source:addr][!/^addr:/] {
738  throwWarning: tr("{0} without {1}", "{0.key}", "addr:*");
739  group: tr("missing tag");
740  assertMatch: "node source:addr=postman";
741  assertNoMatch: "node source:addr=postman addr:housenumber=42";
742}
743*[source:maxspeed][!/^maxspeed:?/] {
744  throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
745  group: tr("missing tag");
746}
747
748/* #16898, tower vs. communications_tower, wiki suggests 100m as rough guideline, so we warn for < 75m */
749*[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' */
750  throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
751  suggestAlternative: "man_made=tower + tower:type=communication + height";
752  group: tr("suspicious tag combination");
753  assertMatch: "node man_made=communications_tower height=58";
754  assertMatch: "node man_made=communications_tower height=\"74 m\"";
755  assertMatch: "node man_made=communications_tower height=0.8";
756  assertMatch: "node man_made=communications_tower height=245'";
757  assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
758  assertMatch: "node man_made=communications_tower height=231'10.22\"";
759  assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
760  assertNoMatch: "node man_made=communications_tower height=75.72";
761  assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
762  assertNoMatch: "node man_made=communications_tower height=4358'8\"";
763  assertNoMatch: "node height=4358'";
764}
Note: See TracBrowser for help on using the repository browser.