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

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

Fix #21286: Add validator rule for min_height < height (patch by skyper, modified)

This additionally fixes an error introduced in r18730.

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