@@ -160,9 +160,11 @@ way[waterway=pressurised ][tunnel!=flooded][man_made!=pipeline] {
160160 group: tr("missing tag");
161161}
162162
163- /* {0.tag} without {1.key} (warning level), #18411, #18246, #20530 */
164- way[railway=construction][!construction],
165- way[highway=construction][!construction],
163+ /* {0.tag} without {1.key} (warning level), #18411, #18246, #20530, #20960 */
164+ way[railway=construction][!construction][!construction:railway],
165+ way[highway=construction][!construction][!construction:highway],
166+ area[building=construction][!construction][!construction:building],
167+ area[landuse=construction][!construction][!construction:landuse],
166168node[traffic_sign=maxspeed][!maxspeed][!/^maxspeed:.+/],
167169*[actuator=manual][!handle],
168170*[mechanical_driver=manual][!handle],
@@ -269,7 +271,9 @@ way[usage=penstock][waterway!=pressurised] {
269271 group: tr("missing tag");
270272}
271273
272- /* {0.key} without {1.key}, {2.key} or {3.key} */
274+ /* {0.key} without {1.key}, {2.key} or {3.key}, see #20960 */
275+ way[construction][!highway][!railway][!waterway]!:closed,
276+ area[construction][!building][!highway][!landuse]:closed,
273277*[snowplowing][!highway][!amenity][!leisure] {
274278 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
275279 group: tr("missing tag");
@@ -309,10 +313,12 @@ way[highway=footway][oneway=no] {
309313 group: tr("suspicious tag combination");
310314}
311315
312- /* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186, #18815 */
316+ /* {0.tag} together with {1.tag}, see #18411, #17950, #17330, #17623, #17592, #17594, #17542, #16861, #16147, #10186, #18815, #20960 */
313317*[barrier=kerb][kerb=no],
314- way[highway=construction][construction=yes],
315- way[railway=construction][construction=yes],
318+ way[highway=construction][construction][construction=~/^(yes|minor|no)$/],
319+ way[railway=construction][construction][construction=~/^(yes|minor|no)$/],
320+ area[building=construction][construction][construction=~/^(yes|minor|no)$/],
321+ area[landuse=construction][construction][construction=~/^(yes|minor|no)$/],
316322*[man_made=bridge][bridge=yes],
317323*[man_made=tunnel][tunnel=yes],
318324*[amenity=police][police],
@@ -437,25 +443,25 @@ way[name][tourism=attraction][eval(number_of_tags()) = 2] {
437443 assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
438444 assertNoMatch: "node place=foo addr:postcode=12345";
439445}
440- *[!highway][ postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
441- throwWarning: tr("{0} together with {1}", "{1 .key}", "{2 .key}");
446+ *[postal_code]["addr:postcode"][!highway ][postal_code=*"addr:postcode"] {
447+ throwWarning: tr("{0} together with {1}", "{0 .key}", "{1 .key}");
442448 group: tr("suspicious tag combination");
443449}
444- *[!highway][ postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
445- throwWarning: tr("{0} together with {1} and conflicting values", "{1 .key}", "{2 .key}");
450+ *[postal_code]["addr:postcode"][!highway ][postal_code!=*"addr:postcode"] {
451+ throwWarning: tr("{0} together with {1} and conflicting values", "{0 .key}", "{1 .key}");
446452 group: tr("suspicious tag combination");
447453}
448- way[highway][ postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
449- throwWarning: tr("{0} together with {1}", "{1 .key}", "{2 .key}");
454+ way[postal_code]["addr:postcode"][highway ][postal_code=*"addr:postcode"] {
455+ throwWarning: tr("{0} together with {1}", "{0 .key}", "{1 .key}");
450456 group: tr("suspicious tag combination");
451457 fixRemove: "addr:postcode";
452458}
453- way[highway][ postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
454- throwWarning: tr("{0} together with {1} and conflicting values", "{1 .key}", "{2 .key}");
459+ way[postal_code]["addr:postcode"][highway ][postal_code!=*"addr:postcode"] {
460+ throwWarning: tr("{0} together with {1} and conflicting values", "{0 .key}", "{1 .key}");
455461 group: tr("suspicious tag combination");
456462}
457- way[highway][highway!=services][highway!=rest_area][!postal_code]["addr:postcode" ] {
458- throwWarning: tr("{0} together with {1}", "{0.key}", "{4 .key}");
463+ way[highway]["addr:postcode"][ highway!=services][highway!=rest_area][!postal_code] {
464+ throwWarning: tr("{0} together with {1}", "{0.key}", "{1 .key}");
459465 suggestAlternative: "postal_code";
460466 group: tr("suspicious tag combination");
461467 fixChangeKey: "addr:postcode=>postal_code";
@@ -488,8 +494,8 @@ way[waterway][oneway][waterway =~ /^(canal|fairway|lock|river|tidal_channel)$/]
488494 group: tr("suspicious tag combination");
489495}
490496
491- *[amenity][amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][!name ][noname!=yes] {
492- throwOther: tr("{0} without {1}", "{0.tag}", "{2 .key}");
497+ *[amenity][!name][ amenity =~ /^(restaurant|cafe|fast_food|pub|place_of_worship|school|university|hospital|library|theatre|courthouse|bank|cinema|pharmacy|fuel)$/][noname!=yes] {
498+ throwOther: tr("{0} without {1}", "{0.tag}", "{1 .key}");
493499 group: tr("missing tag");
494500 assertMatch: "node amenity=restaurant";
495501 assertNoMatch: "node amenity=restaurant noname=yes";
@@ -615,9 +621,9 @@ way["sidewalk:right"][sidewalk][!"sidewalk:left"] {
615621}
616622
617623/* #11837 */
618- way[layer][layer<0][bridge ][bridge!=no][location!=underground][indoor!=yes][!tunnel],
619- way[layer][layer>0][tunnel ][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
620- throwWarning: tr("{0} together with {1}", "{2 .tag}", "{0 .tag}");
624+ way[bridge][ layer][layer<0][bridge!=no][location!=underground][indoor!=yes][!tunnel],
625+ way[tunnel][ layer][layer>0][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
626+ throwWarning: tr("{0} together with {1}", "{0 .tag}", "{1 .tag}");
621627 group: tr("suspicious tag combination");
622628}
623629
@@ -657,10 +663,10 @@ way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered
657663 fixAdd: "unisex=yes";
658664}
659665
660- /* {1 .key} without {2 .tag} see #13138, #14468 */
661- way!:closed [water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir], /* water=intermittent is deprecated and has an own warning */
662- area:closed [water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir] {
663- throwWarning: tr("{0} without {1}", "{1 .key}", "{2 .tag}");
666+ /* {0 .key} without {1 .tag} see #13138, #14468 */
667+ way[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]!:closed , /* water=intermittent is deprecated and has an own warning */
668+ area[water][natural!~/water|bay|strait/][water!=intermittent][amenity!=lavoir]:closed {
669+ throwWarning: tr("{0} without {1}", "{0 .key}", "{1 .tag}");
664670 group: tr("missing tag");
665671}
666672
@@ -709,18 +715,18 @@ way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][on
709715}
710716
711717/* #10932, #19609 */
712- way[highway][!lanes][ /^.*:lanes$/][!source:lanes],
713- way[highway][!lanes][ /^.*:lanes:(forward|backward|both_ways)$/],
714- way[highway][!lanes:both_ways][ /^.*:lanes:both_ways$/] {
715- throwWarning: tr("{0} without {1}", "{2 .key}", "{1.key}");
718+ way[/^.*:lanes$/][highway][!lanes ][!source:lanes],
719+ way[/^.*:lanes:(forward|backward|both_ways)$/][!lanes][highway ],
720+ way[/^.*:lanes:both_ways$/][!lanes:both_ways][highway ] {
721+ throwWarning: tr("{0} without {1}", "{0 .key}", "{1.key}");
716722 group: tr("missing tag");
717723 assertMatch: "way highway=primary turn:lanes=left|right";
718724 assertMatch: "way highway=primary turn:lanes:forward=left|right";
719725 assertNoMatch: "way highway=primary turn:lanes=left|right lanes=2";
720726}
721- way[highway][!lanes:forward][ /^.*:lanes:forward$/][!lanes:backward][mod(tag(lanes),2)=0],
722- way[highway][!lanes:backward][ /^.*:lanes:backward$/][!lanes:forward][mod(tag(lanes),2)=0] {
723- throwOther: tr("{0} without {1}", "{2 .key}", "{1.key}");
727+ way[/^.*:lanes:forward$/][!lanes:forward][!lanes: backward][highway ][mod(tag(lanes),2)=0],
728+ way[/^.*:lanes:backward$/][!lanes:backward][!lanes: forward][highway ][mod(tag(lanes),2)=0] {
729+ throwOther: tr("{0} without {1}", "{0 .key}", "{1.key}");
724730 group: tr("missing tag");
725731 assertMatch: "way highway=primary turn:lanes:forward=left|right lanes=2";
726732 assertNoMatch: "way highway=primary turn:lanes:forward=left|right lanes:forward=2";
@@ -839,9 +845,12 @@ node[emergency_ward_entrance][emergency!=emergency_ward_entrance] {
839845 assertNoMatch: "way construction:building=house construction=house";
840846}
841847
842- /* #18203 */
843- way[construction][construction!=yes][construction!=minor][highway][highway!=construction] {
844- throwWarning: tr("{0} together with {1}", "{3.tag}", "{0.tag}");
848+ /* #18203, #20960 */
849+ way[highway][construction][construction!~/^(yes|minor|no)$/][highway!=construction],
850+ way[railway][construction][construction!~/^(yes|minor|no)$/][railway!=construction],
851+ area[building][construction][construction!~/^(yes|minor|no)$/][building!=construction],
852+ area[landuse][construction][construction!~/^(yes|minor|no)$/][landuse!=construction] {
853+ throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
845854 group: tr("suspicious tag combination");
846855}
847856
@@ -931,11 +940,11 @@ way[highway][!placement][/^placement:.*$/][join_list("", uniq_list(tag_regex("^p
931940 assertNoMatch: "way highway=primary placement:backward=middle_of:1 placement:forward=transition";
932941 assertNoMatch: "way highway=primary placement=middle_of:1 placement:backward=transition placement:forward=transition";
933942}
934- way[highway][ placement][/^placement:.*$/]!.PlacementTransitionWarning,
935- way[highway][ "placement:forward"]["placement:backward"]!.PlacementTransitionWarning,
936- way[highway][ "placement:forward"]["placement:both_ways"]!.PlacementTransitionWarning,
937- way[highway][ "placement:backward"]["placement:both_ways"]!.PlacementTransitionWarning {
938- throwError: tr("{0} together with {1}", "{1 .key}", "{2 .key}");
943+ way[placement][/^placement:.*$/][highway ]!.PlacementTransitionWarning,
944+ way["placement:forward"]["placement:backward"][highway ]!.PlacementTransitionWarning,
945+ way["placement:forward"]["placement:both_ways"][highway ]!.PlacementTransitionWarning,
946+ way["placement:backward"]["placement:both_ways"][highway ]!.PlacementTransitionWarning {
947+ throwError: tr("{0} together with {1}", "{0 .key}", "{1 .key}");
939948 group: tr("suspicious tag combination");
940949 assertMatch: "way highway=primary placement=left_of:2 placement:forward=right_of:1";
941950 assertNoMatch: "way highway=primary placement:forward=right_of:1";
0 commit comments