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

Last change on this file since 18530 was 18527, checked in by taylor.smock, 3 years ago

Fix #22102: Add a warning if surface does not match tracktype (patch by mkoniecz)

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