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

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

fix #22576 - Warn about amenity=marketplace together with highway

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