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

Last change on this file since 18459 was 18450, checked in by Klumbumbus, 3 years ago

see #22073 - Add asserts

  • Property svn:eol-style set to native
File size: 52.3 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 #22033 */
542*[/_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] {
543 throwWarning: tr("alternative name without {0}", "{1.key}");
544 group: tr("missing tag");
545 assertMatch: "way alt_name=Foo";
546 assertNoMatch: "way alt_name=Foo name=Bar";
547}
548
549/* #19604 */
550way[name][alt_name][name=*alt_name] {
551 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
552 group: tr("suspicious tag combination");
553 fixRemove: "alt_name";
554}
555
556/* #10837 */
557way[destination][!oneway?][junction!=roundabout][highway] {
558 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
559 suggestAlternative: "destination:forward";
560 suggestAlternative: "destination:backward";
561}
562
563/* #11389, #19010 */
564way[maxspeed:forward][maxspeed:backward][!maxspeed]["maxspeed:forward"=*"maxspeed:backward"] {
565 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
566 suggestAlternative: "maxspeed";
567 group: tr("suspicious tag combination");
568 fixChangeKey: "maxspeed:forward=>maxspeed";
569 fixRemove: "maxspeed:backward";
570}
571way[maxspeed:forward][maxspeed:backward][maxspeed]["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed] {
572 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
573 set AllSameMaxspeed;
574 suggestAlternative: "maxspeed";
575 group: tr("suspicious tag combination");
576 fixRemove: "maxspeed:forward";
577 fixRemove: "maxspeed:backward";
578}
579way[cycleway:left][cycleway:right][!cycleway]["cycleway:left"=*"cycleway:right"] {
580 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
581 suggestAlternative: "cycleway";
582 group: tr("suspicious tag combination");
583 fixChangeKey: "cycleway:left=>cycleway";
584 fixRemove: "cycleway:right";
585}
586way[cycleway:left][cycleway:right][cycleway]["cycleway:left"=*cycleway]["cycleway:right"=*cycleway] {
587 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
588 set AllSameCycleway;
589 suggestAlternative: "cycleway";
590 group: tr("suspicious tag combination");
591 fixRemove: "cycleway:left";
592 fixRemove: "cycleway:right";
593}
594way[sidewalk:left][sidewalk:right][!sidewalk]["sidewalk:left"=*"sidewalk:right"] {
595 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
596 suggestAlternative: "sidewalk";
597 group: tr("suspicious tag combination");
598 fixChangeKey: "sidewalk:left=>sidewalk";
599 fixRemove: "sidewalk:right";
600}
601way[sidewalk:left][sidewalk:right][sidewalk]["sidewalk:left"=*sidewalk]["sidewalk:right"=*sidewalk] {
602 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
603 set AllSameSidewalk;
604 suggestAlternative: "sidewalk";
605 group: tr("suspicious tag combination");
606 fixRemove: "sidewalk:left";
607 fixRemove: "sidewalk:right";
608}
609way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed,
610way["cycleway:left"]["cycleway:right"][cycleway]!.AllSameCycleway,
611way["sidewalk:left"]["sidewalk:right"][sidewalk]!.AllSameSidewalk {
612 throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
613 group: tr("suspicious tag combination");
614}
615way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
616way["maxspeed:backward"][maxspeed][!"maxspeed:forward"],
617way["cycleway:left"][cycleway][!"cycleway:right"],
618way["cycleway:right"][cycleway][!"cycleway:left"],
619way["sidewalk:left"][sidewalk][!"sidewalk:right"],
620way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
621 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
622 group: tr("suspicious tag combination");
623}
624
625/* #11837 */
626way[bridge][layer][layer<0][bridge!=no][location!=underground][indoor!=yes][!tunnel],
627way[tunnel][layer][layer>0][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
628 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
629 group: tr("suspicious tag combination");
630}
631
632/* #12942 */
633relation[oneway][type!=route] {
634 throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
635}
636
637/* #9182 */
638way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
639 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}");
640 group: tr("suspicious tag combination");
641}
642way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
643 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}");
644 group: tr("suspicious tag combination");
645}
646
647/* #13144, #15536 */
648*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
649*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
650 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
651 group: tr("suspicious tag combination");
652}
653*[unisex=yes][female=yes][male=yes][shop=hairdresser] {
654 throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
655 group: tr("suspicious tag combination");
656 fixRemove: "female";
657 fixRemove: "male";
658}
659*[female=yes][male=yes][!unisex][shop=hairdresser] {
660 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
661 suggestAlternative: "unisex=yes";
662 group: tr("suspicious tag combination");
663 fixRemove: "female";
664 fixRemove: "male";
665 fixAdd: "unisex=yes";
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 /* don't 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][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 */
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*[amenity=recycling][collection_times="24/7"][opening_hours],
871*[amenity=recycling][collection_times ][opening_hours][collection_times=~/[a-z]-[A-Z].*[0-9]-[0-9]/] {
872 throwWarning: tr("{0} together with {1}. Probably {2} is meant.", "{1.key}", "{0.tag}", "{2.key}");
873 group: tr("suspicious tag combination");
874}
875
876/* #19018 */
877way[highway][crossing][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] {
878 throwWarning: tr("{0} together with {1}. Should be used on a minor highway type or a node", "{1.key}", "{0.tag}");
879 group: tr("suspicious tag combination");
880 fixRemove: "crossing";
881 assertMatch: "way highway=trunk crossing=unmarked";
882 assertNoMatch: "way highway=construction construction=footway crossing=unmarked";
883}
884
885/* #19066 */
886*[amenity=recycling][!/^recycling:/][recycling_type!=centre] {
887 throwWarning: tr("{0} without {1}", "{0.tag}", "recycling:*");
888 group: tr("missing tag");
889}
890*[source:addr][!/^addr:/] {
891 throwWarning: tr("{0} without {1}", "{0.key}", "addr:*");
892 group: tr("missing tag");
893 assertMatch: "node source:addr=postman";
894 assertNoMatch: "node source:addr=postman addr:housenumber=42";
895}
896*[source:maxspeed][!/^maxspeed:?/] {
897 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
898 group: tr("missing tag");
899}
900
901/* #16898, tower vs. communications_tower, wiki suggests 100m as rough guideline, so we warn for < 75m */
902*[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' */
903 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
904 suggestAlternative: "man_made=tower + tower:type=communication + height";
905 group: tr("suspicious tag combination");
906 assertMatch: "node man_made=communications_tower height=58";
907 assertMatch: "node man_made=communications_tower height=\"74 m\"";
908 assertMatch: "node man_made=communications_tower height=0.8";
909 assertMatch: "node man_made=communications_tower height=245'";
910 assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
911 assertMatch: "node man_made=communications_tower height=231'10.22\"";
912 assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
913 assertNoMatch: "node man_made=communications_tower height=75.72";
914 assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
915 assertNoMatch: "node man_made=communications_tower height=4358'8\"";
916 assertNoMatch: "node height=4358'";
917}
918
919/* #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. */
920*[fixme][count(split(" ", tag("fixme"))) == 1][has_tag_key(tag("fixme"))],
921*[FIXME][count(split(" ", tag("FIXME"))) == 1][has_tag_key(tag("FIXME"))] {
922 throwWarning: tr("{0} together with {1}. Is the fixme fixed?", "{0.tag}", "{0.value}");
923 group: tr("suspicious tag combination");
924 assertMatch: "way name=\"Florist Gump\" fixme=name";
925 assertMatch: "way name=\"Florist Gump\" FIXME=name";
926 assertNoMatch: "way fixme=name";
927 assertNoMatch: "way name=\"Florist Gump\"";
928 assertNoMatch: "way name=\"Florist Gump\" fixme=\"the name might have changed\"";
929}
930
931/* #19094 */
932way[highway][placement=transition][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition],
933way[highway][!placement][/^placement:.*$/][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition] {
934 throwWarning: tr("Use {0} only as value of {1}", "transition", "placement");
935 set PlacementTransitionWarning;
936 fixAdd: "placement=transition";
937 fixRemove: "placement:forward";
938 fixRemove: "placement:backward";
939 fixRemove: "placement:both_ways";
940 assertMatch: "way highway=primary placement=transition placement:both_ways=transition";
941 assertMatch: "way highway=primary placement:backward=transition placement:forward=transition";
942 assertNoMatch: "way highway=primary placement:backward=middle_of:1 placement:forward=transition";
943 assertNoMatch: "way highway=primary placement=middle_of:1 placement:backward=transition placement:forward=transition";
944}
945way[placement][/^placement:.*$/][highway]!.PlacementTransitionWarning,
946way["placement:forward"]["placement:backward"][highway]!.PlacementTransitionWarning,
947way["placement:forward"]["placement:both_ways"][highway]!.PlacementTransitionWarning,
948way["placement:backward"]["placement:both_ways"][highway]!.PlacementTransitionWarning {
949 throwError: tr("{0} together with {1}", "{0.key}", "{1.key}");
950 group: tr("suspicious tag combination");
951 assertMatch: "way highway=primary placement=left_of:2 placement:forward=right_of:1";
952 assertNoMatch: "way highway=primary placement:forward=right_of:1";
953 assertNoMatch: "way highway=primary placement:forward=transition placement:both_ways=transition";
954}
955
956/* #19742 */
957node:righthandtraffic[highway=mini_roundabout][direction=clockwise] {
958 throwWarning: tr("{0} together with {1} at right-hand traffic", "{1.tag}", "{2.tag}");
959 group: tr("suspicious tag combination");
960}
961node!:righthandtraffic[highway=mini_roundabout][direction=anticlockwise] {
962 throwWarning: tr("{0} together with {1} at left-hand traffic", "{1.tag}", "{2.tag}");
963 group: tr("suspicious tag combination");
964}
965
966/* #19603 */
967way[footway][highway][footway=sidewalk ][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
968 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
969 group: tr("suspicious tag combination");
970 suggestAlternative: "sidewalk=left";
971 suggestAlternative: "sidewalk=right";
972 suggestAlternative: "sidewalk=both";
973 suggestAlternative: "sidewalk=separate";
974}
975way[footway][highway][footway!=sidewalk][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
976 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
977 group: tr("suspicious tag combination");
978}
979way[footway][!highway][!/:highway$/],
980way[cycleway][!highway][!/:highway$/] {
981 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
982 group: tr("missing tag");
983 assertNoMatch: "way footway=sidewalk abandoned:highway=unclassified";
984}
985
986/* #17498 */
987way[bicycle][/^cycleway(:|$)/][!/^bicycle:/][bicycle=~/^(no|use_sidepath)$/][/^cycleway(:|$)/!~/^(no|none|separate)$/] {
988 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
989 group: tr("suspicious tag combination");
990 assertMatch: "way bicycle=no cycleway=track";
991 assertMatch: "way bicycle=use_sidepath cycleway=lane";
992 assertMatch: "way bicycle=use_sidepath cycleway:left=lane";
993 assertNoMatch: "way bicycle=use_sidepath cycleway=no";
994 assertNoMatch: "way bicycle=use_sidepath bicycle:backward=yes cycleway:left=lane"; /* instead of :backward, could also be :forward or :conditional */
995 assertNoMatch: "way bicycle=no cycleway:right=no";
996 assertNoMatch: "way bicycle=use_sidepath cycleway:left=none";
997 assertNoMatch: "way highway=cycleway cycleway=separate";
998 assertNoMatch: "way highway=residential bicycle=use_sidepath";
999}
1000
1001/* #19980 */
1002way[highway=living_street][maxspeed][maxspeed=~/mph/][get(split(" ", tag(maxspeed)), 0) > 15],
1003way[highway=living_street][maxspeed][maxspeed!~/mph/][get(split(" ", tag(maxspeed)), 0) > 20] {
1004 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
1005 group: tr("suspicious tag combination");
1006 assertNoMatch: "way highway=living_street";
1007 assertNoMatch: "way highway=living_street maxspeed=20";
1008 assertNoMatch: "way highway=living_street maxspeed=\"15 mph\"";
1009 assertNoMatch: "way highway=living_street maxspeed=walk";
1010 assertMatch: "way highway=living_street maxspeed=30";
1011 assertMatch: "way highway=living_street maxspeed=\"20 mph\"";
1012}
1013
1014/* piste subtags, see #17606 */
1015way[piste:type=nordic][!piste:grooming] {
1016 throwWarning: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1017 group: tr("missing tag");
1018 assertMatch: "way piste:type=nordic";
1019 assertNoMatch: "way piste:type=nordic piste:grooming=classic";
1020}
1021
1022way[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty][count(parent_tags("piste:difficulty")) == 0] {
1023 set missing_parent_piste_difficulty;
1024}
1025way.missing_parent_piste_difficulty:new,
1026way.missing_parent_piste_difficulty:in-downloaded-area!:new {
1027 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1028 group: tr("missing tag");
1029 set missing_piste_difficulty;
1030 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1031}
1032relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] >
1033 way[!piste:difficulty]!.missing_piste_difficulty {
1034 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1035 group: tr("missing tag");
1036 set missing_piste_difficulty_both;
1037 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1038}
1039way[piste:type=nordic][!piste:difficulty]!.missing_piste_difficulty!.missing_piste_difficulty_both {
1040 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1041 group: tr("missing tag");
1042 assertMatch: "way piste:type=nordic";
1043 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1044}
1045
1046relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] {
1047 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1048 group: tr("missing tag");
1049 assertMatch: "relation piste:type=nordic";
1050 assertNoMatch: "relation piste:type=nordic piste:difficulty=easy";
1051}
1052relation[piste:type=nordic][!piste:grooming]{
1053 throwOther: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1054 group: tr("missing tag");
1055 assertMatch: "relation piste:type=nordic";
1056 assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
1057}
Note: See TracBrowser for help on using the repository browser.