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

Last change on this file since 18659 was 18659, checked in by taylor.smock, 22 months ago

Fix #22547: tunnel=culvert should have waterway=* or man_made=tunnel (patch by skyper)

  • Property svn:eol-style set to native
File size: 53.1 KB
Line 
1/* Rules partially derived from Taginfo statistics - see ticket #5017
2 * Taginfo query: select keypairs.key1, keypairs.key2, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key1='waterway' and keys.key=keypairs.key2 and (key1<>'highway' or keypairs.count_all>12000) and (key1<>'railway' or keypairs.count_all>3000) and (key1<>'waterway' or keypairs.count_all>800) and key2 not like '%:%' and from_fraction_all>0.97 and 1 union select keypairs.key2, keypairs.key1, keypairs.count_all, keys.count_all, cast(keypairs.count_all as real)/keys.count_all as from_fraction_all from keys, keypairs where key2='waterway' and keys.key=keypairs.key1 and (key2<>'highway' or keypairs.count_all>12000) and (key2<>'railway' or keypairs.count_all>3000) and (key2<>'waterway' or keypairs.count_all>800) and key1 not like '%:%' and from_fraction_all>0.97 and 1 order by keypairs.count_all desc limit 1000;
3 */
4
5way[surface=~/^(unpaved|compacted|gravel|fine_gravel|pebblestone|ground|earth|dirt|grass|sand|mud|ice|salt|snow|woodchips)$/] { /* without grass_paver as it is controversial */
6 set unpaved_surface;
7}
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*[archaeological_site ][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}, #22547 */
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}
246way[tunnel=culvert][man_made!=tunnel][!waterway] {
247 throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.key}");
248 group: tr("suspicious tag combination");
249 set TunnelCulvertWithoutWaterway;
250}
251
252/* {0.tag} without {1.tag} (info level) see #11600 #11393 #11850 */
253way[highway=motorway][!oneway][junction!=roundabout],
254way[highway=motorway_link][!oneway][junction!=roundabout] {
255 throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
256 group: tr("missing tag");
257}
258
259/* {0.tag} without {1.tag} */
260way[usage=penstock][man_made!=pipeline],
261way[usage=penstock][waterway!=pressurised] {
262 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
263 group: tr("missing tag");
264}
265
266/* {0.tag} without {1.tag} or {2.tag} */
267*[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
268 throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
269 group: tr("missing tag");
270}
271
272/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.key} */
273*[smoothness][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/][barrier!=kerb][!kerb] {
274 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.key}");
275 group: tr("missing tag");
276}
277
278/* {0.key} without {1.key}, {2.tag}, {3.tag} or {4.tag} */
279*[intermittent ][!waterway][natural!~/^(water|spring)$/][landuse!~/^(basin|reservoir)$/][ford!~/^(yes|stepping_stones)$/],
280*[boat ][!waterway][natural!=water ][landuse!~/^(basin|reservoir)$/][ford!=yes] {
281 throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
282 group: tr("missing tag");
283}
284
285/* {0.key} without {1.key}, {2.key} or {3.key} */
286*[snowplowing][!highway][!amenity][!leisure] {
287 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
288 group: tr("missing tag");
289}
290
291/* {0.key} without {1.key}, {2.key} or {3.tag} */
292*[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
293 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
294 group: tr("missing tag");
295}
296
297/* {0.tag} together with {1.key}, see #22576, #17664, #17707, #16464, #10837, #14034, #9389, #11977, #13156, #16888, #20530, #21736, #22076 */
298*[amenity=marketplace][highway],
299*[power=plant][/^generator:/],
300*[power=generator][/^plant:/],
301*[power=plant][voltage],
302*[power=plant][frequency],
303*[internet_access=no][internet_access:fee],
304node[power=transformer][voltage],
305node[transformer=distribution][voltage][power=pole],
306*[amenity=vending_machine][shop],
307*[noname?][name],
308*[noref?][ref],
309*[nohousenumber?][addr:housenumber],
310*[actuator][handle][actuator !~ /(^|;)manual(;|$)/],
311*[mechanical_driver][handle][mechanical_driver !~ /(^|;)manual(;|$)/],
312way[oneway=yes][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
313way[oneway=yes][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
314way[oneway=-1 ][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/],
315way[oneway=-1 ][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][/^oneway:(bicycle|bus|mofa|moped|psv)$/!~/^no$/] {
316 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
317 group: tr("suspicious tag combination");
318 assertMatch: "way power=plant generator:source=wind";
319 assertMatch: "way power=generator plant:source=combustion";
320}
321
322/* {0.tag} together with {1.tag} (info level), see #9696 */
323way[highway=footway][oneway=no] {
324 throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
325 group: tr("suspicious tag combination");
326}
327
328/* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186, #18815, #20960 */
329*[barrier=kerb][kerb=no],
330way[highway=construction][construction][construction=~/^(yes|minor|no)$/],
331way[railway=construction][construction][construction=~/^(yes|minor|no)$/],
332area[building=construction][construction][construction=~/^(yes|minor|no)$/],
333area[landuse=construction][construction][construction=~/^(yes|minor|no)$/],
334*[man_made=bridge][bridge=yes],
335*[man_made=tunnel][tunnel=yes],
336*[amenity=police][police],
337node[highway=crossing][crossing=no],
338node[railway=crossing][crossing=no],
339way[junction=yes][highway],
340way[tracktype=grade1][surface].unpaved_surface,
341way[tracktype=grade2][surface][surface=~/^(sand|mud|ground|earth|dirt|grass|ice|salt|snow|woodchips)$/],
342way[tracktype=grade4][surface].fully_paved_surface,
343way[tracktype=grade5][surface].fully_paved_surface,
344way[segregated][bicycle=no],
345way[segregated][foot=no],
346way[man_made=pipeline][tunnel=flooded] {
347 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
348 group: tr("suspicious tag combination");
349}
350
351/* {0.tag} together with {1.tag} (error level) */
352relation[type=multipolygon][area=no] {
353 throwError: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
354 group: tr("suspicious tag combination");
355}
356
357/* {0.key} together with {1.key}, #18267, #17630, #17604, #21836 */
358node[transformer][voltage],
359node[marker][cover],
360node[marker][voltage],
361node[marker][pressure],
362node[marker][diameter],
363node[marker][substance],
364*[building:part][building],
365*[addr:street][addr:place][outside("CZ,DK")] {
366 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
367 group: tr("suspicious tag combination");
368}
369
370/* {0.tag} together with {1.tag} and {2.key}, #18471 */
371way[highway=~/^(cycleway|footway|path)$/][segregated=no][sidewalk =~/^(left|right|both)$/] {
372 throwWarning: tr("{0} together with {1} and {2}", "{0.tag}", "{1.tag}", "{2.key}");
373 group: tr("suspicious tag combination");
374}
375
376/* {0.key} together with {1.tag} and {2.key}, #19747 */
377way[railway][electrified=no][frequency],
378way[railway][electrified=no][voltage] {
379 throwWarning: tr("{0} together with {1} and {2}", "{0.key}", "{1.tag}", "{2.key}");
380 group: tr("suspicious tag combination");
381}
382
383/* #11127, #13727 */
384way[waterway][bridge=yes][waterway!=weir] {
385 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
386 suggestAlternative: "bridge=aqueduct";
387 group: tr("suspicious tag combination");
388 fixAdd: "bridge=aqueduct";
389}
390way[waterway=weir][bridge=yes][highway] {
391 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
392 suggestAlternative: "waterway=weir + ford=yes";
393 suggestAlternative: "waterway=dam";
394 suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
395 group: tr("suspicious tag combination");
396}
397
398/* #16214 */
399relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
400 throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
401 fixRemove: "area";
402 set area_yes_autofix;
403 group: tr("suspicious tag combination");
404}
405
406/* only {0.key}, #11104, #12422, #14950, #19572, #20902 */
407/* relations excluded as there is a test for missing type=* plus several other test depending on the type exist */
408node[access][eval(number_of_tags()) = 1],
409way[access][eval(number_of_tags()) = 1],
410node[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
411way[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
412node[lanes][eval(number_of_tags()) = 1],
413way[lanes][eval(number_of_tags()) = 1],
414node[layer][eval(number_of_tags()) = 1],
415way[layer][eval(number_of_tags()) = 1],
416way[level][eval(number_of_tags()) = 1], /* nodes might be valid, e.g. start and end nodes of steps */
417node[lit][eval(number_of_tags()) = 1],
418way[lit][eval(number_of_tags()) = 1],
419node[name][eval(number_of_tags()) = 1],
420way[name][eval(number_of_tags()) = 1],
421node[ref][eval(number_of_tags()) = 1],
422way[ref][eval(number_of_tags()) = 1],
423node[surface][eval(number_of_tags()) = 1],
424way[surface][eval(number_of_tags()) = 1] {
425 throwWarning: tr("incomplete object: only {0}", "{0.key}");
426 set only_one_tag;
427 group: tr("missing tag");
428}
429/* only {0.key} and {1.key} */
430node[name][area][eval(number_of_tags()) = 2],
431way[name][area][eval(number_of_tags()) = 2],
432node[name][ref][eval(number_of_tags()) = 2],
433way[name][ref][eval(number_of_tags()) = 2] {
434 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
435 group: tr("missing tag");
436}
437/* only {0.tag}, #15269 */
438node[tourism=attraction][eval(number_of_tags()) = 1],
439way[tourism=attraction][eval(number_of_tags()) = 1] {
440 throwWarning: tr("incomplete object: only {0}", "{0.tag}");
441 group: tr("missing tag");
442}
443/* only {0.key} and {1.tag} */
444node[name][tourism=attraction][eval(number_of_tags()) = 2],
445way[name][tourism=attraction][eval(number_of_tags()) = 2] {
446 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
447 group: tr("missing tag");
448}
449
450/* #9811, #11491, #12865, #14310 */
451*[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)$/],
452/* addr:postcode is used together with place in some countries */
453*[boundary][/^addr:/],
454*[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
455 throwWarning: tr("{0} together with {1}", "{0.key}", "addr:*");
456 group: tr("suspicious tag combination");
457 assertMatch: "node place=foo addr:housenumber=5";
458 assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
459 assertNoMatch: "node place=foo addr:postcode=12345";
460}
461*[postal_code]["addr:postcode"][!highway][postal_code=*"addr:postcode"] {
462 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
463 group: tr("suspicious tag combination");
464}
465*[postal_code]["addr:postcode"][!highway][postal_code!=*"addr:postcode"] {
466 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
467 group: tr("suspicious tag combination");
468}
469way[postal_code]["addr:postcode"][highway][postal_code=*"addr:postcode"] {
470 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
471 group: tr("suspicious tag combination");
472 fixRemove: "addr:postcode";
473}
474way[postal_code]["addr:postcode"][highway][postal_code!=*"addr:postcode"] {
475 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
476 group: tr("suspicious tag combination");
477}
478way[highway]["addr:postcode"][highway!=services][highway!=rest_area][!postal_code] {
479 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
480 suggestAlternative: "postal_code";
481 group: tr("suspicious tag combination");
482 fixChangeKey: "addr:postcode=>postal_code";
483}
484
485/* #9195 */
486way[highway=footway][cycleway=lane] {
487 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
488 suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
489 group: tr("suspicious tag combination");
490}
491
492/* {0} on suspicious object, #17255, #19650, #19572, #17253, #19821, #15667, #19930, #20435, #20471, #18815 */
493way[oneway ][!highway][!area:highway][!railway][!aerialway][attraction!=summer_toboggan][aeroway!~/^(runway|taxiway)$/][leisure!=track][waterway !~ /^(canal|fairway|lock|river|tidal_channel)$/],
494node[lanes ][!barrier][!ford][highway!=mini_roundabout][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
495way[lanes ][!barrier][!ford][!highway ][!area:highway][!junction][leisure!~/^(bowling_alley|slipway|swimming_pool|track)$/][!traffic_calming]!.only_one_tag,
496*[tunnel ][!highway][!area:highway][!railway][!waterway][!piste:type][type!=tunnel][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=wildlife_crossing][man_made!=tunnel][power!=cable]!.TunnelCulvertWithoutWaterway,
497*[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],
498*[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.*/],
499*[width ][!highway][!area:highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone][leisure!=track],
500*[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],
501way[incline][!highway][!area:highway][!railway][aeroway!~/^(runway|taxiway)$/][attraction!=summer_toboggan][leisure!=slipway] {
502 throwWarning: tr("{0} on suspicious object", "{0.key}");
503 group: tr("suspicious tag combination");
504}
505
506/* #15667, #19930 */
507way[waterway][oneway][waterway =~ /^(canal|fairway|lock|river|tidal_channel)$/] {
508 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}");
509 group: tr("suspicious tag combination");
510}
511
512*[amenity][!name][amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][noname!=yes] {
513 throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
514 group: tr("missing tag");
515 assertMatch: "node amenity=restaurant";
516 assertNoMatch: "node amenity=restaurant noname=yes";
517 assertNoMatch: "node amenity=restaurant name=Foobar";
518}
519
520/* #10193, #16157 */
521way[highway][barrier],
522*[highway][waterway][waterway!=dam][waterway!=weir],
523way[highway][natural][natural!=ridge],
524*[landuse][building][landuse!=retail] {
525 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
526 group: tr("suspicious tag combination");
527 assertNoMatch: "node highway=street_lamp natural=birds_nest";
528}
529
530/* #6932 */
531*[natural=water][leisure=swimming_pool] {
532 throwWarning: tr("natural water used for swimming pool");
533 group: tr("suspicious tag combination");
534 fixRemove: "natural";
535}
536
537/* #9593, #11183, #12418, #12761, #17254, #19311 */
538*[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] {
539 throwWarning: tr("sport without physical feature");
540 group: tr("missing tag");
541 assertMatch: "node sport=tennis";
542 assertNoMatch: "node sport=tennis leisure=pitch";
543 assertNoMatch: "node sport=beachvolleyball natural=beach";
544 assertNoMatch: "node sport=skiing"; /* skiing has deprecated warning */
545 assertNoMatch: "node sport=swimming tourism=hotel";
546 assertNoMatch: "node sport=10pin amenity=restaurant";
547}
548
549/* {0.key} without {1.key} or {2.key} see #10140 */
550*[building:levels][!building][!building:part],
551way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] {
552 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
553 group: tr("missing tag");
554}
555
556/* any other *_name tag (with some exceptions) but not a name , see #10837 #11297 #11539 #16437 #17026 #22033 */
557*[/_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] {
558 throwWarning: tr("alternative name without {0}", "{1.key}");
559 group: tr("missing tag");
560 assertMatch: "way alt_name=Foo";
561 assertNoMatch: "way alt_name=Foo name=Bar";
562}
563
564/* #19604 */
565way[name][alt_name][name=*alt_name] {
566 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
567 group: tr("suspicious tag combination");
568 fixRemove: "alt_name";
569}
570
571/* #10837 */
572way[destination][!oneway?][junction!=roundabout][highway] {
573 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
574 suggestAlternative: "destination:forward";
575 suggestAlternative: "destination:backward";
576}
577
578/* #11389, #19010 */
579way[maxspeed:forward][maxspeed:backward][!maxspeed]["maxspeed:forward"=*"maxspeed:backward"] {
580 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
581 suggestAlternative: "maxspeed";
582 group: tr("suspicious tag combination");
583 fixChangeKey: "maxspeed:forward=>maxspeed";
584 fixRemove: "maxspeed:backward";
585}
586way[maxspeed:forward][maxspeed:backward][maxspeed]["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed] {
587 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
588 set AllSameMaxspeed;
589 suggestAlternative: "maxspeed";
590 group: tr("suspicious tag combination");
591 fixRemove: "maxspeed:forward";
592 fixRemove: "maxspeed:backward";
593}
594way[cycleway:left][cycleway:right][!cycleway]["cycleway:left"=*"cycleway:right"] {
595 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
596 suggestAlternative: "cycleway";
597 group: tr("suspicious tag combination");
598 fixChangeKey: "cycleway:left=>cycleway";
599 fixRemove: "cycleway:right";
600}
601way[cycleway:left][cycleway:right][cycleway]["cycleway:left"=*cycleway]["cycleway:right"=*cycleway] {
602 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
603 set AllSameCycleway;
604 suggestAlternative: "cycleway";
605 group: tr("suspicious tag combination");
606 fixRemove: "cycleway:left";
607 fixRemove: "cycleway:right";
608}
609way[sidewalk:left][sidewalk:right][!sidewalk]["sidewalk:left"=*"sidewalk:right"] {
610 throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
611 suggestAlternative: "sidewalk";
612 group: tr("suspicious tag combination");
613 fixChangeKey: "sidewalk:left=>sidewalk";
614 fixRemove: "sidewalk:right";
615}
616way[sidewalk:left][sidewalk:right][sidewalk]["sidewalk:left"=*sidewalk]["sidewalk:right"=*sidewalk] {
617 throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
618 set AllSameSidewalk;
619 suggestAlternative: "sidewalk";
620 group: tr("suspicious tag combination");
621 fixRemove: "sidewalk:left";
622 fixRemove: "sidewalk:right";
623}
624way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed,
625way["cycleway:left"]["cycleway:right"][cycleway]!.AllSameCycleway,
626way["sidewalk:left"]["sidewalk:right"][sidewalk]!.AllSameSidewalk {
627 throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
628 group: tr("suspicious tag combination");
629}
630way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
631way["maxspeed:backward"][maxspeed][!"maxspeed:forward"],
632way["cycleway:left"][cycleway][!"cycleway:right"],
633way["cycleway:right"][cycleway][!"cycleway:left"],
634way["sidewalk:left"][sidewalk][!"sidewalk:right"],
635way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
636 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
637 group: tr("suspicious tag combination");
638}
639
640/* #11837 */
641way[bridge][layer][layer<0][bridge!=no][location!=underground][indoor!=yes][!tunnel],
642way[tunnel][layer][layer>0][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
643 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
644 group: tr("suspicious tag combination");
645}
646
647/* #12942 */
648relation[oneway][type!=route] {
649 throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
650}
651
652/* #9182 */
653way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
654 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}");
655 group: tr("suspicious tag combination");
656}
657way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
658 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}");
659 group: tr("suspicious tag combination");
660}
661
662/* #13144, #15536 */
663*[unisex=yes][female=yes][male!=yes][shop=hairdresser],
664*[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
665 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
666 group: tr("suspicious tag combination");
667}
668*[unisex=yes][female=yes][male=yes][shop=hairdresser] {
669 throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
670 group: tr("suspicious tag combination");
671 fixRemove: "female";
672 fixRemove: "male";
673}
674*[female=yes][male=yes][!unisex][shop=hairdresser] {
675 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
676 suggestAlternative: "unisex=yes";
677 group: tr("suspicious tag combination");
678 fixRemove: "female";
679 fixRemove: "male";
680 fixAdd: "unisex=yes";
681}
682
683/* {0.key} without {1.tag} see #13138, #14468 */
684way[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]!:closed, /* water=intermittent is deprecated and has an own warning */
685area[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]:closed {
686 throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
687 group: tr("missing tag");
688}
689
690/* #13680 */
691area[golf=bunker][natural=beach] {
692 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
693 suggestAlternative: "natural=sand";
694 suggestAlternative: "surface=sand";
695 group: tr("suspicious tag combination");
696}
697
698/* #13705 */
699relation[type=multipolygon][building] > way {
700 set part_of_building_MP;
701}
702way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier][place!=plot]!.part_of_building_MP {
703 /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
704 throwOther: tr("possibly missing {0} tag", "{1.key}");
705 group: tr("missing tag");
706}
707
708/* see #8519, #11529, limited to motorways and trunks to avoid false positives for streets with lanes for non motorized traffic */
709way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/] {
710 set MotorwayTrunk;
711}
712way.MotorwayTrunk[lanes][turn:lanes ][tag(lanes)!=eval(count(split("|", tag("turn:lanes"))))],
713way.MotorwayTrunk[lanes][change:lanes ][tag(lanes)!=eval(count(split("|", tag("change:lanes"))))],
714way.MotorwayTrunk[lanes][maxspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("maxspeed:lanes"))))],
715way.MotorwayTrunk[lanes][minspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("minspeed:lanes"))))],
716way.MotorwayTrunk[lanes][destination:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:lanes"))))],
717way.MotorwayTrunk[lanes][destination:ref:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:ref:lanes"))))],
718way.MotorwayTrunk[lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
719 throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
720 group: tr("suspicious tag combination");
721}
722
723/* #14125, #14323, #18185 */
724way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][oneway!=reversible][highway!=motorway][junction!=roundabout][lanes>2][mod(tag(lanes),2)=1] {
725 throwWarning: tr("street with odd number of {0}, but without {1} and {2} or {3}", "{1.key}", "{2.key}", "{3.key}", "{4.key}");
726 group: tr("missing tag");
727 assertNoMatch: "way highway=primary lanes=2";
728 assertNoMatch: "way highway=primary lanes=3 lanes:backward=2";
729 assertNoMatch: "way highway=primary lanes=3 oneway=-1";
730 assertNoMatch: "way highway=primary lanes=4";
731 assertMatch: "way highway=primary lanes=3";
732}
733
734/* #10932, #19609 */
735way[/^.*:lanes$/][!lanes][highway][!source:lanes],
736way[/^.*:lanes:(forward|backward|both_ways)$/][!lanes][highway],
737way[/^.*:lanes:both_ways$/][!lanes:both_ways][highway] {
738 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
739 group: tr("missing tag");
740 assertMatch: "way highway=primary turn:lanes=left|right";
741 assertMatch: "way highway=primary turn:lanes:forward=left|right";
742 assertNoMatch: "way highway=primary turn:lanes=left|right lanes=2";
743}
744way[/^.*:lanes:forward$/][!lanes:forward][!lanes:backward][highway][mod(tag(lanes),2)=0],
745way[/^.*:lanes:backward$/][!lanes:backward][!lanes:forward][highway][mod(tag(lanes),2)=0] {
746 throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
747 group: tr("missing tag");
748 assertMatch: "way highway=primary turn:lanes:forward=left|right lanes=2";
749 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes:forward=2";
750 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes=3";
751}
752
753/* #15774 */
754node[emergency=fire_hydrant][fire_hydrant:count][fire_hydrant:count!=1] {
755 throwOther: tr("{0} together with {1}. Tag each hydrant separately.", "{0.tag}", "{1.tag}");
756}
757
758/* #12502 */
759node[leisure=park][natural=tree] {
760 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
761 group: tr("suspicious tag combination");
762 fixRemove: "leisure";
763}
764
765/* #17305 */
766area[boundary=administrative][landuse=residential] {
767 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
768 group: tr("suspicious tag combination");
769}
770
771/* #17391 */
772way[highway=pedestrian][width][width<3] {
773 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
774 suggestAlternative: "highway=footway";
775 group: tr("suspicious tag combination");
776 fixAdd: "highway=footway";
777 assertMatch: "way highway=pedestrian width=0.8";
778 assertMatch: "way highway=pedestrian width=1";
779 assertNoMatch: "way highway=pedestrian width=3";
780 assertNoMatch: "way highway=pedestrian width=5.5";
781}
782
783/* see #17623 */
784way:areaStyle[highway][highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service$|living_street|pedestrian|track|path|footway|cycleway|busway|bus_guideway|bridleway/][area!=yes] {
785 throwOther: tr("A linear object {0} without {1} has a tag indicating that it is an area.", "{1.tag}", "{3.tag}");
786 group: tr("suspicious tag combination");
787}
788
789/* #17804 */
790area[cemetery=sector][landuse=cemetery] {
791 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
792 group: tr("suspicious tag combination");
793}
794
795/* #17967 */
796*[highway=cycleway][cycleway=track] {
797 throwWarning: tr("{0} together with {1}. Remove {1}.", "{0.tag}", "{1.tag}");
798 group: tr("suspicious tag combination");
799 fixRemove: "cycleway";
800}
801
802/* #17973, #18183, #18331, #20318 */
803way[highway=path ][!segregated][foot=designated][bicycle=designated],
804way[highway=footway ][!segregated][bicycle=designated],
805way[highway=cycleway][!segregated][foot=designated] {
806 throwWarning: tr("Combined foot- and cycleway without {0}.", "{1.key}");
807 group: tr("missing tag");
808}
809
810/* #17989 */
811node[emergency_ward_entrance][emergency!=emergency_ward_entrance] {
812 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
813 group: tr("missing tag");
814 fixAdd: "emergency=emergency_ward_entrance";
815}
816
817/* missing or conflicting construction, see #17607 */
818/* {0.key} without {1.key} and {2.key} */
819*[construction:building][!building][!construction],
820*[construction:highway][!highway][!construction],
821*[construction:railway][!railway][!construction],
822*[construction:landuse][!landuse][!construction] {
823 throwWarning: tr("{0} without {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
824 group: tr("missing tag");
825 fixAdd: "{1.key}=construction";
826 fixAdd: "construction={0.value}";
827 assertMatch: "way construction:building=house";
828 assertNoMatch: "way construction:building=house building=house ";
829 assertNoMatch: "way construction:building=house construction=house";
830}
831/* {0.key} and {1.key} without {2.key} */
832*[building=construction]["construction:building"][!construction],
833*[highway=construction]["construction:highway"][!construction],
834*[railway=construction]["construction:railway"][!construction],
835*[landuse=construction]["construction:landuse"][!construction] {
836 throwWarning: tr("{0} together with {1} but without {2}", "{0.key}", "{1.key}", "{2.key}");
837 group: tr("missing tag");
838 fixAdd: "construction={1.value}";
839 assertMatch: "way construction:building=house building=construction";
840 assertNoMatch: "way construction:building=house building=house ";
841 assertNoMatch: "way construction:building=house construction=house";
842}
843/* {0.key} and {1.key} without {2.key} */
844*[building]["construction:building"][!construction][building!=construction],
845*[highway]["construction:highway"][!construction][highway!=construction],
846*[railway]["construction:railway"][!construction][railway!=construction],
847*[landuse]["construction:landuse"][!construction][landuse!=construction] {
848 throwWarning: tr("{0} together with {1} and conflicting values plus no {2}", "{0.key}", "{1.key}", "{2.key}");
849 group: tr("suspicious tag combination");
850 assertMatch: "way construction:building=house building=office";
851 assertNoMatch: "way construction:building=house building=construction";
852 assertNoMatch: "way construction:building=house construction=house";
853}
854
855*["construction:building"][construction][construction:building != *construction],
856*["construction:highway"][construction][construction:highway != *construction],
857*["construction:railway"][construction][construction:railway != *construction],
858*["construction:landuse"][construction][construction:landuse != *construction] {
859 throwWarning: tr("{0} together with {1} and conflicting values", "{0.key}", "{1.key}");
860 group: tr("suspicious tag combination");
861 assertMatch: "way construction:building=house construction=office";
862 assertNoMatch: "way construction:building=house construction=house";
863}
864
865/* #18203, #20960 */
866way[highway][construction][construction!~/^(yes|minor|no)$/][highway!=construction],
867way[railway][construction][construction!~/^(yes|minor|no)$/][railway!=construction],
868area[building][construction][construction!~/^(yes|minor|no)$/][building!=construction],
869area[landuse][construction][construction!~/^(yes|minor|no)$/][landuse!=construction] {
870 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
871 group: tr("suspicious tag combination");
872}
873
874/* #18374, #22295 */
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 fixChangeKey: "collection_times => opening_hours";
880 assertMatch: "node amenity=recycling collection_times=\"Mo-Fr 06:00-20:00\"";
881 assertNoMatch: "node amenity=recycling collection_times=\"Mo-Fr 15:00\"";
882 assertNoMatch: "node amenity=recycling collection_times=\"Mo 08:00-11:00\"";
883 assertNoMatch: "node amenity=recycling collection_times=\"Sa[2,4] 8:00-11:00\"";
884}
885
886/* #19018 */
887way[highway][crossing][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/] {
888 throwWarning: tr("{0} together with {1}. Should be used on a minor highway type or a node", "{1.key}", "{0.tag}");
889 group: tr("suspicious tag combination");
890 fixRemove: "crossing";
891 assertMatch: "way highway=trunk crossing=unmarked";
892 assertNoMatch: "way highway=construction construction=footway crossing=unmarked";
893}
894
895/* #19066 */
896*[amenity=recycling][!/^recycling:/][recycling_type!=centre] {
897 throwWarning: tr("{0} without {1}", "{0.tag}", "recycling:*");
898 group: tr("missing tag");
899}
900*[source:addr][!/^addr:/] {
901 throwWarning: tr("{0} without {1}", "{0.key}", "addr:*");
902 group: tr("missing tag");
903 assertMatch: "node source:addr=postman";
904 assertNoMatch: "node source:addr=postman addr:housenumber=42";
905}
906*[source:maxspeed][!/^maxspeed:?/] {
907 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "maxspeed", "maxspeed:*");
908 group: tr("missing tag");
909}
910
911/* #16898, tower vs. communications_tower, wiki suggests 100m as rough guideline, so we warn for < 75m */
912*[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' */
913 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
914 suggestAlternative: "man_made=tower + tower:type=communication + height";
915 group: tr("suspicious tag combination");
916 assertMatch: "node man_made=communications_tower height=58";
917 assertMatch: "node man_made=communications_tower height=\"74 m\"";
918 assertMatch: "node man_made=communications_tower height=0.8";
919 assertMatch: "node man_made=communications_tower height=245'";
920 assertMatch: "node man_made=communications_tower height=\"224.22 ft\"";
921 assertMatch: "node man_made=communications_tower height=231'10.22\"";
922 assertNoMatch: "node man_made=communications_tower height=\"75 m\"";
923 assertNoMatch: "node man_made=communications_tower height=75.72";
924 assertNoMatch: "node man_made=communications_tower height=\"328.22 ft\"";
925 assertNoMatch: "node man_made=communications_tower height=4358'8\"";
926 assertNoMatch: "node height=4358'";
927}
928
929/* #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. */
930*[fixme][count(split(" ", tag("fixme"))) == 1][has_tag_key(tag("fixme"))],
931*[FIXME][count(split(" ", tag("FIXME"))) == 1][has_tag_key(tag("FIXME"))] {
932 throwWarning: tr("{0} together with {1}. Is the fixme fixed?", "{0.tag}", "{0.value}");
933 group: tr("suspicious tag combination");
934 assertMatch: "way name=\"Florist Gump\" fixme=name";
935 assertMatch: "way name=\"Florist Gump\" FIXME=name";
936 assertNoMatch: "way fixme=name";
937 assertNoMatch: "way name=\"Florist Gump\"";
938 assertNoMatch: "way name=\"Florist Gump\" fixme=\"the name might have changed\"";
939}
940
941/* #19094 */
942way[highway][placement=transition][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition],
943way[highway][!placement][/^placement:.*$/][join_list("", uniq_list(tag_regex("^placement:.*$")))==transition] {
944 throwWarning: tr("Use {0} only as value of {1}", "transition", "placement");
945 set PlacementTransitionWarning;
946 fixAdd: "placement=transition";
947 fixRemove: "placement:forward";
948 fixRemove: "placement:backward";
949 fixRemove: "placement:both_ways";
950 assertMatch: "way highway=primary placement=transition placement:both_ways=transition";
951 assertMatch: "way highway=primary placement:backward=transition placement:forward=transition";
952 assertNoMatch: "way highway=primary placement:backward=middle_of:1 placement:forward=transition";
953 assertNoMatch: "way highway=primary placement=middle_of:1 placement:backward=transition placement:forward=transition";
954}
955way[placement][/^placement:.*$/][highway]!.PlacementTransitionWarning,
956way["placement:forward"]["placement:backward"][highway]!.PlacementTransitionWarning,
957way["placement:forward"]["placement:both_ways"][highway]!.PlacementTransitionWarning,
958way["placement:backward"]["placement:both_ways"][highway]!.PlacementTransitionWarning {
959 throwError: tr("{0} together with {1}", "{0.key}", "{1.key}");
960 group: tr("suspicious tag combination");
961 assertMatch: "way highway=primary placement=left_of:2 placement:forward=right_of:1";
962 assertNoMatch: "way highway=primary placement:forward=right_of:1";
963 assertNoMatch: "way highway=primary placement:forward=transition placement:both_ways=transition";
964}
965
966/* #19742 */
967node:righthandtraffic[highway=mini_roundabout][direction=clockwise] {
968 throwWarning: tr("{0} together with {1} at right-hand traffic", "{1.tag}", "{2.tag}");
969 group: tr("suspicious tag combination");
970}
971node!:righthandtraffic[highway=mini_roundabout][direction=anticlockwise] {
972 throwWarning: tr("{0} together with {1} at left-hand traffic", "{1.tag}", "{2.tag}");
973 group: tr("suspicious tag combination");
974}
975
976/* #19603 */
977way[footway][highway][footway=sidewalk ][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
978 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
979 group: tr("suspicious tag combination");
980 suggestAlternative: "sidewalk=left";
981 suggestAlternative: "sidewalk=right";
982 suggestAlternative: "sidewalk=both";
983 suggestAlternative: "sidewalk=separate";
984}
985way[footway][highway][footway!=sidewalk][highway!~/^(path|footway|cycleway|construction|proposed)$/] {
986 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
987 group: tr("suspicious tag combination");
988}
989way[footway][!highway][!/:highway$/],
990way[cycleway][!highway][!/:highway$/] {
991 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
992 group: tr("missing tag");
993 assertNoMatch: "way footway=sidewalk abandoned:highway=unclassified";
994}
995
996/* #17498 */
997way[bicycle][/^cycleway(:|$)/][!/^bicycle:/][bicycle=~/^(no|use_sidepath)$/][/^cycleway(:|$)/!~/^(no|none|separate)$/] {
998 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
999 group: tr("suspicious tag combination");
1000 assertMatch: "way bicycle=no cycleway=track";
1001 assertMatch: "way bicycle=use_sidepath cycleway=lane";
1002 assertMatch: "way bicycle=use_sidepath cycleway:left=lane";
1003 assertNoMatch: "way bicycle=use_sidepath cycleway=no";
1004 assertNoMatch: "way bicycle=use_sidepath bicycle:backward=yes cycleway:left=lane"; /* instead of :backward, could also be :forward or :conditional */
1005 assertNoMatch: "way bicycle=no cycleway:right=no";
1006 assertNoMatch: "way bicycle=use_sidepath cycleway:left=none";
1007 assertNoMatch: "way highway=cycleway cycleway=separate";
1008 assertNoMatch: "way highway=residential bicycle=use_sidepath";
1009}
1010
1011/* #19980 */
1012way[highway=living_street][maxspeed][maxspeed=~/mph/][get(split(" ", tag(maxspeed)), 0) > 15],
1013way[highway=living_street][maxspeed][maxspeed!~/mph/][get(split(" ", tag(maxspeed)), 0) > 20] {
1014 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
1015 group: tr("suspicious tag combination");
1016 assertNoMatch: "way highway=living_street";
1017 assertNoMatch: "way highway=living_street maxspeed=20";
1018 assertNoMatch: "way highway=living_street maxspeed=\"15 mph\"";
1019 assertNoMatch: "way highway=living_street maxspeed=walk";
1020 assertMatch: "way highway=living_street maxspeed=30";
1021 assertMatch: "way highway=living_street maxspeed=\"20 mph\"";
1022}
1023
1024/* piste subtags, see #17606 */
1025way[piste:type=nordic][!piste:grooming] {
1026 throwWarning: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1027 group: tr("missing tag");
1028 assertMatch: "way piste:type=nordic";
1029 assertNoMatch: "way piste:type=nordic piste:grooming=classic";
1030}
1031
1032way[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty][count(parent_tags("piste:difficulty")) == 0] {
1033 set missing_parent_piste_difficulty;
1034}
1035way.missing_parent_piste_difficulty:new,
1036way.missing_parent_piste_difficulty:in-downloaded-area!:new {
1037 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1038 group: tr("missing tag");
1039 set missing_piste_difficulty;
1040 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1041}
1042relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] >
1043 way[!piste:difficulty]!.missing_piste_difficulty {
1044 throwWarning: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1045 group: tr("missing tag");
1046 set missing_piste_difficulty_both;
1047 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1048}
1049way[piste:type=nordic][!piste:difficulty]!.missing_piste_difficulty!.missing_piste_difficulty_both {
1050 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1051 group: tr("missing tag");
1052 assertMatch: "way piste:type=nordic";
1053 assertNoMatch: "way piste:type=nordic piste:difficulty=easy";
1054}
1055
1056relation[piste:type =~ /^downhill|nordic|skitour$/][!piste:difficulty] {
1057 throwOther: tr("No difficulty defined for skiing, add {0}", "piste:difficulty=");
1058 group: tr("missing tag");
1059 assertMatch: "relation piste:type=nordic";
1060 assertNoMatch: "relation piste:type=nordic piste:difficulty=easy";
1061}
1062relation[piste:type=nordic][!piste:grooming]{
1063 throwOther: tr("No grooming defined for {0} skiing, add {1}", "nordic", "piste:grooming=");
1064 group: tr("missing tag");
1065 assertMatch: "relation piste:type=nordic";
1066 assertNoMatch: "relation piste:type=nordic piste:grooming=classic";
1067}
1068
1069/* #21836 */
1070*[voltage:primary][voltage:secondary][transformer=generator][tag("voltage:secondary")<tag("voltage:primary")] {
1071 throwWarning: tr("{0} is lower than {1} on {2}.", "{1.key}", "{0.key}", "{2.tag}");
1072 group: tr("suspicious tag combination");
1073}
Note: See TracBrowser for help on using the repository browser.