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

Last change on this file since 18446 was 18446, checked in by Klumbumbus, 2 years ago

fix #22009, see #20960 - Fix incorrect warning message *:lanes without highway (instead of lanes) (patch by skyper)

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