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

Last change on this file since 18461 was 18460, checked in by Klumbumbus, 4 years ago

fix #22076 - Add nohousenumber=yes checkbox, warn about combinations of nohousenumber=yes + addr:housenumber=* and noref=yes + ref=* (based on patch by taylor.smock)

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