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

Last change on this file since 19591 was 19591, checked in by stoecker, 2 days ago

fix #22748 - patch by francois.lacombe - Extend utility=* to buildings, street cabinets and industrial landuses

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