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

Last change on this file since 17051 was 17051, checked in by Klumbumbus, 4 years ago

fix #19603 - Warn about suspicious tag combinations with footway=* (based on patch by Famlam)

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