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

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

See #22547: move ticket reference to just above rule

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