| 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 |
|
|---|
| 5 | /* {0.key} without {1.key} (warning level) */
|
|---|
| 6 | way[junction ][!highway][junction!=yes],
|
|---|
| 7 | way[lanes ][!highway][leisure!=track][leisure!=swimming_pool],
|
|---|
| 8 | way[living_street ][!highway],
|
|---|
| 9 | way[maintenance ][!highway],
|
|---|
| 10 | way[median ][!highway],
|
|---|
| 11 | way[motorroad ][!highway],
|
|---|
| 12 | node[ntd_id ][!highway],
|
|---|
| 13 | way[sac_scale ][!highway],
|
|---|
| 14 | way[sidewalk ][!highway],
|
|---|
| 15 | way[step_count ][!highway][man_made!=tower],
|
|---|
| 16 | way[tracktype ][!highway],
|
|---|
| 17 | way[trail_visibility ][!highway], /* #15029 */
|
|---|
| 18 | way[trolley_wire ][!highway],
|
|---|
| 19 | way[zip_left ][!highway],
|
|---|
| 20 | way[zip_right ][!highway],
|
|---|
| 21 | way[detail ][!railway][route!=railway],
|
|---|
| 22 | way[eddy_current_brake ][!railway][route!=railway],
|
|---|
| 23 | way[electrified ][!railway][route!=railway][!highway], /* #16007 */
|
|---|
| 24 | way[etcs ][!railway][route!=railway],
|
|---|
| 25 | way[gauge ][!railway][route!=railway],
|
|---|
| 26 | way[grade_of_track ][!railway][route!=railway],
|
|---|
| 27 | way[kursbuchstrecke ][!railway][route!=railway],
|
|---|
| 28 | way[lzb ][!railway][route!=railway],
|
|---|
| 29 | way[old_railway_operator ][!railway][route!=railway],
|
|---|
| 30 | way[operating_procedure ][!railway][route!=railway],
|
|---|
| 31 | way[pzb ][!railway][route!=railway],
|
|---|
| 32 | way[structure_gauge ][!railway][route!=railway],
|
|---|
| 33 | way[tilting_technology ][!railway][route!=railway],
|
|---|
| 34 | way[track_class ][!railway][route!=railway],
|
|---|
| 35 | way[tracks ][!railway][route!=railway],
|
|---|
| 36 | way[traffic_mode ][!railway][route!=railway],
|
|---|
| 37 | way[workrules ][!railway][route!=railway],
|
|---|
| 38 | way[stream ][!waterway],
|
|---|
| 39 | way[length_unit ][!waterway],
|
|---|
| 40 | way[canal ][!waterway],
|
|---|
| 41 | way[have_riverbank ][!waterway],
|
|---|
| 42 | *[border_type ][!boundary],
|
|---|
| 43 | *[piste:difficulty ][!piste:type],
|
|---|
| 44 | *[source:date ][!source],
|
|---|
| 45 | *[source:name ][!name],
|
|---|
| 46 | *[source:maxspeed:forward ][!maxspeed:forward][!maxspeed],
|
|---|
| 47 | *[source:maxspeed:backward ][!maxspeed:backward][!maxspeed],
|
|---|
| 48 | *[source:building ][!building],
|
|---|
| 49 | *[source:ref ][!ref],
|
|---|
| 50 | *[source:population ][!population],
|
|---|
| 51 | *[source:postal_code ][!postal_code],
|
|---|
| 52 | *[source:ele ][!ele],
|
|---|
| 53 | *[source:ref:INSEE ][!ref:INSEE],
|
|---|
| 54 | *[source:lit ][!lit],
|
|---|
| 55 | *[source:hgv ][!hgv],
|
|---|
| 56 | *[source:highway ][!highway],
|
|---|
| 57 | *[source:maxaxleload ][!maxaxleload],
|
|---|
| 58 | *[source:surface ][!surface],
|
|---|
| 59 | *[source:bridge ][!bridge],
|
|---|
| 60 | *[source:old_name ][!old_name],
|
|---|
| 61 | *[source:bicycle ][!bicycle],
|
|---|
| 62 | *[source:designation ][!designation],
|
|---|
| 63 | *[source:height ][!height],
|
|---|
| 64 | *[source:lanes ][!lanes],
|
|---|
| 65 | *[source:postcode ][!addr:postcode],
|
|---|
| 66 | *[source:housenumber ][!addr:housenumber],
|
|---|
| 67 | *[source:addr:postcode ][!addr:postcode],
|
|---|
| 68 | *[source:addr:housenumber ][!addr:housenumber],
|
|---|
| 69 | *[source:addr ][!/^addr:/],
|
|---|
| 70 | *[source:maxspeed ][!/^maxspeed:?/] {
|
|---|
| 71 | throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
|
|---|
| 72 | group: tr("missing tag");
|
|---|
| 73 | assertMatch: "way lanes=42";
|
|---|
| 74 | assertNoMatch: "way lanes=42 highway=unclassified";
|
|---|
| 75 | assertMatch: "node source:addr:postcode=postman";
|
|---|
| 76 | assertMatch: "node source:addr=postman";
|
|---|
| 77 | assertNoMatch: "node source:addr=postman addr:housenumber=42";
|
|---|
| 78 | }
|
|---|
| 79 |
|
|---|
| 80 | /* {0.key} without {1.key} (info level) */
|
|---|
| 81 | way[lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1],
|
|---|
| 82 | way[lanes:backward][!lanes:forward][oneway!=yes][oneway!=-1],
|
|---|
| 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} */
|
|---|
| 90 | *[transformer ][!power],
|
|---|
| 91 | way[fence_type ][barrier!=fence],
|
|---|
| 92 | *[recycling_type ][amenity!=recycling],
|
|---|
| 93 | *[information ][tourism!=information],
|
|---|
| 94 | node[board_type ][information!=board],
|
|---|
| 95 | *[shelter_type ][amenity!=shelter],
|
|---|
| 96 | node[lamp_type ][highway!=street_lamp],
|
|---|
| 97 | node[map_type ][information!=map],
|
|---|
| 98 | *[site_type ][historic!=archaeological_site],
|
|---|
| 99 | *[artwork_type ][tourism!=artwork][exhibit!=artwork],
|
|---|
| 100 | *[castle_type ][historic!=castle],
|
|---|
| 101 | *[parking ][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/],
|
|---|
| 102 | way[cutline ][man_made!=cutline],
|
|---|
| 103 | *[bunker_type ][military!=bunker] {
|
|---|
| 104 | throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
|
|---|
| 105 | group: tr("missing tag");
|
|---|
| 106 | }
|
|---|
| 107 |
|
|---|
| 108 | /* {0.key} without {1.tag} or {2.tag} */
|
|---|
| 109 | *[bridge:movable ][bridge!=movable][man_made!=bridge],
|
|---|
| 110 | *[substation ][power!=substation][pipeline!=substation],
|
|---|
| 111 | *[reservoir_type ][landuse!=reservoir][water!=reservoir],
|
|---|
| 112 | way[waterway=pressurised ][tunnel!=flooded][man_made!=pipeline] {
|
|---|
| 113 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.tag}", "{2.tag}");
|
|---|
| 114 | group: tr("missing tag");
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 | /* {0.tag} without {1.key} (warning level) */
|
|---|
| 118 | way[boundary=administrative][!admin_level],
|
|---|
| 119 | relation[boundary=administrative][!admin_level],
|
|---|
| 120 | relation[route=bicycle][!network][type=route],
|
|---|
| 121 | relation[route=hiking][!network][type=route],
|
|---|
| 122 | relation[route=foot][!network][type=route],
|
|---|
| 123 | relation[route=horse][!network][type=route],
|
|---|
| 124 | relation[route=piste][!piste:type][type=route],
|
|---|
| 125 | relation[route=ski][!piste:type][type=route],
|
|---|
| 126 | *[tourism=information][!information],
|
|---|
| 127 | *[leisure=pitch][!sport],
|
|---|
| 128 | *[aeroway=terminal][!building],
|
|---|
| 129 | *[power=generator][!generator:source],
|
|---|
| 130 | *[amenity=social_facility][!social_facility],
|
|---|
| 131 | *[amenity=place_of_worship][!religion] {
|
|---|
| 132 | throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
|
|---|
| 133 | group: tr("missing tag");
|
|---|
| 134 | }
|
|---|
| 135 |
|
|---|
| 136 | /* {0.tag} without {1.key} (info level) */
|
|---|
| 137 | way[highway=track ][!tracktype],
|
|---|
| 138 | way[power=cable ][!location],
|
|---|
| 139 | node[power=transformer ][!voltage:primary],
|
|---|
| 140 | node[power=transformer ][!voltage:secondary],
|
|---|
| 141 | node[transformer=distribution ][!voltage:primary][power=pole],
|
|---|
| 142 | node[transformer=distribution ][!voltage:secondary][power=pole],
|
|---|
| 143 | way[power=line ][!voltage],
|
|---|
| 144 | way[power=minor_line ][!voltage],
|
|---|
| 145 | way[power=cable ][!voltage],
|
|---|
| 146 | *[power=generator ][!voltage][generator:output:electricity],
|
|---|
| 147 | *[power=plant ][!voltage][plant:output:electricity],
|
|---|
| 148 | *[power=substation ][!substation],
|
|---|
| 149 | *[power=switch ][!switch],
|
|---|
| 150 | *[power=transformer ][!transformer],
|
|---|
| 151 | *[amenity=parking ][!parking],
|
|---|
| 152 | *[amenity=parking_entrance ][!parking] {
|
|---|
| 153 | throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
|
|---|
| 154 | group: tr("missing tag");
|
|---|
| 155 | assertMatch: "way power=line";
|
|---|
| 156 | assertNoMatch: "way power=line voltage=1";
|
|---|
| 157 | assertMatch: "way power=switch";
|
|---|
| 158 | assertMatch: "way power=substation";
|
|---|
| 159 | assertMatch: "way power=substation transformer=foobar";
|
|---|
| 160 | assertNoMatch: "way power=substation substation=foobar";
|
|---|
| 161 | assertMatch: "way power=generator generator:output:electricity=yes";
|
|---|
| 162 | assertNoMatch: "way power=generator";
|
|---|
| 163 | assertNoMatch: "way power=generator generator:output:electricity=yes voltage=1";
|
|---|
| 164 | }
|
|---|
| 165 |
|
|---|
| 166 | /* {0.key} without {1.key} or {2.tag} */
|
|---|
| 167 | way[bridge:structure ][!bridge][man_made!=bridge],
|
|---|
| 168 | *[smoothness ][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking)$/],
|
|---|
| 169 | *[segregated ][!highway][railway!=crossing] {
|
|---|
| 170 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
|
|---|
| 171 | group: tr("missing tag");
|
|---|
| 172 | }
|
|---|
| 173 |
|
|---|
| 174 | /* {0.tag} without {1.tag} (info level) see #11600 #11393 #11850 */
|
|---|
| 175 | way[highway=motorway][!oneway][junction!=roundabout],
|
|---|
| 176 | way[highway=motorway_link][!oneway][junction!=roundabout] {
|
|---|
| 177 | throwOther: tr("{0} without {1}", "{0.tag}", "{1.tag}");
|
|---|
| 178 | group: tr("missing tag");
|
|---|
| 179 | }
|
|---|
| 180 |
|
|---|
| 181 | /* {0.tag} without {1.tag} */
|
|---|
| 182 | way[usage=penstock][man_made!=pipeline],
|
|---|
| 183 | way[usage=penstock][waterway!=pressurised] {
|
|---|
| 184 | throwWarning: tr("{0} without {1}", "{0.tag}", "{1.tag}");
|
|---|
| 185 | group: tr("missing tag");
|
|---|
| 186 | }
|
|---|
| 187 |
|
|---|
| 188 | /* {0.tag} without {1.tag} or {2.tag} */
|
|---|
| 189 | *[amenity=recycling][recycling_type!=container][recycling_type!=centre] {
|
|---|
| 190 | throwWarning: tr("{0} without {1} or {2}", "{0.tag}", "{1.tag}", "{2.tag}");
|
|---|
| 191 | group: tr("missing tag");
|
|---|
| 192 | }
|
|---|
| 193 |
|
|---|
| 194 | /* {0.key} without {1.key}, {2.tag} or {3.tag} */
|
|---|
| 195 | *[intermittent ][!waterway][natural!~/^(water|spring)$/][landuse!~/^(basin|reservoir)$/][ford!=yes],
|
|---|
| 196 | *[boat ][!waterway][natural!=water ][landuse!~/^(basin|reservoir)$/][ford!=yes] {
|
|---|
| 197 | throwWarning: tr("{0} without {1}, {2}, {3} or {4}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}", "{4.tag}");
|
|---|
| 198 | group: tr("missing tag");
|
|---|
| 199 | }
|
|---|
| 200 |
|
|---|
| 201 | /* {0.key} without {1.key}, {2.key} or {3.key} */
|
|---|
| 202 | way[oneway][!highway][!railway][!aerialway],
|
|---|
| 203 | *[snowplowing ][!highway][!amenity][!leisure] {
|
|---|
| 204 | throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
|
|---|
| 205 | group: tr("missing tag");
|
|---|
| 206 | }
|
|---|
| 207 |
|
|---|
| 208 | /* {0.key} without {1.key}, {2.key} or {3.tag} */
|
|---|
| 209 | way[incline ][!highway][!railway][aeroway!~/^(runway|taxiway)$/],
|
|---|
| 210 | *[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
|
|---|
| 211 | throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
|
|---|
| 212 | group: tr("missing tag");
|
|---|
| 213 | }
|
|---|
| 214 |
|
|---|
| 215 | /* {0.tag} together with {1.key}, see #16464, #10837, #14034, #9389, #11977, #13156, #16888 */
|
|---|
| 216 | *[internet_access=no][internet_access:fee],
|
|---|
| 217 | node[power=transformer][voltage],
|
|---|
| 218 | node[transformer=distribution][voltage][power=pole],
|
|---|
| 219 | *[amenity=vending_machine][shop],
|
|---|
| 220 | *[noname?][name],
|
|---|
| 221 | way[oneway=yes][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no],
|
|---|
| 222 | way[oneway=yes][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][oneway:bicycle!=no][oneway:psv!=no],
|
|---|
| 223 | way[oneway=-1 ][/:backward/][!traffic_sign:backward][bicycle:backward!=use_sidepath][oneway:bicycle!=no][oneway:psv!=no],
|
|---|
| 224 | way[oneway=-1 ][/:forward/ ][!traffic_sign:forward ][bicycle:forward!=use_sidepath ][oneway:bicycle!=no][oneway:psv!=no] {
|
|---|
| 225 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
|
|---|
| 226 | group: tr("suspicious tag combination");
|
|---|
| 227 | }
|
|---|
| 228 |
|
|---|
| 229 | /* {0.tag} together with {1.tag} (info level), see #9696 */
|
|---|
| 230 | way[highway=footway][oneway=no] {
|
|---|
| 231 | throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 232 | group: tr("suspicious tag combination");
|
|---|
| 233 | }
|
|---|
| 234 |
|
|---|
| 235 | /* {0.tag} together with {1.tag}, see #16861, #16147, #10186 */
|
|---|
| 236 | way[segregated][bicycle=no],
|
|---|
| 237 | way[segregated][foot=no],
|
|---|
| 238 | way[man_made=pipeline][tunnel=flooded],
|
|---|
| 239 | way[waterway=canal][tunnel=yes],
|
|---|
| 240 | way[highway=footway][bicycle=designated] {
|
|---|
| 241 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 242 | group: tr("suspicious tag combination");
|
|---|
| 243 | }
|
|---|
| 244 |
|
|---|
| 245 | /* {0.key} together with {1.key} (info level) */
|
|---|
| 246 | *[addr:street][addr:place] {
|
|---|
| 247 | throwOther: tr("{0} together with {1}", "{0.key}", "{1.key}");
|
|---|
| 248 | group: tr("suspicious tag combination");
|
|---|
| 249 | }
|
|---|
| 250 |
|
|---|
| 251 | /* #11127, #13727 */
|
|---|
| 252 | way[waterway][bridge=yes][waterway!=weir] {
|
|---|
| 253 | throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
|
|---|
| 254 | suggestAlternative: "bridge=aqueduct";
|
|---|
| 255 | group: tr("suspicious tag combination");
|
|---|
| 256 | fixAdd: "bridge=aqueduct";
|
|---|
| 257 | }
|
|---|
| 258 | way[waterway=weir][bridge=yes][highway] {
|
|---|
| 259 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 260 | suggestAlternative: "waterway=weir + ford=yes";
|
|---|
| 261 | suggestAlternative: "waterway=dam";
|
|---|
| 262 | suggestAlternative: tr("two objects, one with {0} and one with {1} + {2} + {3}", "{0.tag}", "{2.key}", "{1.tag}", "layer");
|
|---|
| 263 | group: tr("suspicious tag combination");
|
|---|
| 264 | }
|
|---|
| 265 |
|
|---|
| 266 | /* #16214 */
|
|---|
| 267 | relation[type=multipolygon] >[role="inner"] way[area][eval(number_of_tags()) = 1] {
|
|---|
| 268 | throwWarning: tr("{0} on an inner multipolygon ring without further tags", "{0.tag}");
|
|---|
| 269 | fixRemove: "area";
|
|---|
| 270 | set area_yes_autofix;
|
|---|
| 271 | group: tr("suspicious tag combination");
|
|---|
| 272 | }
|
|---|
| 273 |
|
|---|
| 274 | /* only {0.key}, see #11104 #12422 #14950 */
|
|---|
| 275 | *[access][eval(number_of_tags()) = 1],
|
|---|
| 276 | *[area][eval(number_of_tags()) = 1]!.area_yes_autofix,
|
|---|
| 277 | *[name][eval(number_of_tags()) = 1],
|
|---|
| 278 | *[ref][eval(number_of_tags()) = 1],
|
|---|
| 279 | *[lit][eval(number_of_tags()) = 1] {
|
|---|
| 280 | throwWarning: tr("incomplete object: only {0}", "{0.key}");
|
|---|
| 281 | group: tr("missing tag");
|
|---|
| 282 | }
|
|---|
| 283 | /* only {0.key} and {1.key} */
|
|---|
| 284 | *[name][area][eval(number_of_tags()) = 2],
|
|---|
| 285 | *[name][ref][eval(number_of_tags()) = 2] {
|
|---|
| 286 | throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
|
|---|
| 287 | group: tr("missing tag");
|
|---|
| 288 | }
|
|---|
| 289 | /* only {0.tag}, #15269 */
|
|---|
| 290 | *[tourism=attraction][eval(number_of_tags()) = 1] {
|
|---|
| 291 | throwWarning: tr("incomplete object: only {0}", "{0.tag}");
|
|---|
| 292 | group: tr("missing tag");
|
|---|
| 293 | }
|
|---|
| 294 | /* only {0.key} and {1.tag} */
|
|---|
| 295 | *[name][tourism=attraction][eval(number_of_tags()) = 2] {
|
|---|
| 296 | throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.tag}");
|
|---|
| 297 | group: tr("missing tag");
|
|---|
| 298 | }
|
|---|
| 299 |
|
|---|
| 300 | /* #9811, #11491, #12865, #14310 */
|
|---|
| 301 | *[place][place!=farm][/^(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)$/],
|
|---|
| 302 | /* addr:postcode is used together with place in some countries */
|
|---|
| 303 | *[boundary][/^addr:/],
|
|---|
| 304 | *[highway][/^addr:/][highway!=services][highway!=rest_area][!"addr:postcode"] {
|
|---|
| 305 | throwWarning: tr("{0} together with addr:*", "{0.key}");
|
|---|
| 306 | group: tr("suspicious tag combination");
|
|---|
| 307 | assertMatch: "node place=foo addr:housenumber=5";
|
|---|
| 308 | assertMatch: "node place=foo addr:housenumber=5 addr:postcode=12345";
|
|---|
| 309 | assertNoMatch: "node place=foo addr:postcode=12345";
|
|---|
| 310 | }
|
|---|
| 311 | *[!highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
|
|---|
| 312 | throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
|
|---|
| 313 | group: tr("suspicious tag combination");
|
|---|
| 314 | }
|
|---|
| 315 | *[!highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
|
|---|
| 316 | throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
|
|---|
| 317 | group: tr("suspicious tag combination");
|
|---|
| 318 | }
|
|---|
| 319 | way[highway][postal_code]["addr:postcode"][postal_code=*"addr:postcode"] {
|
|---|
| 320 | throwWarning: tr("{0} together with {1}", "{1.key}", "{2.key}");
|
|---|
| 321 | group: tr("suspicious tag combination");
|
|---|
| 322 | fixRemove: "addr:postcode";
|
|---|
| 323 | }
|
|---|
| 324 | way[highway][postal_code]["addr:postcode"][postal_code!=*"addr:postcode"] {
|
|---|
| 325 | throwWarning: tr("{0} together with {1} and conflicting values", "{1.key}", "{2.key}");
|
|---|
| 326 | group: tr("suspicious tag combination");
|
|---|
| 327 | }
|
|---|
| 328 | way[highway][highway!=services][highway!=rest_area][!postal_code]["addr:postcode"] {
|
|---|
| 329 | throwWarning: tr("{0} together with {1}", "{0.key}", "{4.key}");
|
|---|
| 330 | suggestAlternative: "postal_code";
|
|---|
| 331 | group: tr("suspicious tag combination");
|
|---|
| 332 | fixChangeKey: "addr:postcode=>postal_code";
|
|---|
| 333 | }
|
|---|
| 334 |
|
|---|
| 335 | /* #9195 */
|
|---|
| 336 | way[highway=footway][cycleway=lane] {
|
|---|
| 337 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 338 | suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
|
|---|
| 339 | group: tr("suspicious tag combination");
|
|---|
| 340 | }
|
|---|
| 341 |
|
|---|
| 342 | /* {0} on suspicious object */
|
|---|
| 343 | *[tunnel ][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor],
|
|---|
| 344 | *[bridge ][!highway][!railway][!waterway][!piste:type][public_transport!=platform][route!=ferry][man_made!=pipeline][man_made!=goods_conveyor][man_made!=bridge][building!=bridge],
|
|---|
| 345 | *[psv ][!highway][!railway][!waterway][amenity !~ /^parking.*/],
|
|---|
| 346 | *[width ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance][natural!=stone],
|
|---|
| 347 | *[maxspeed][!highway][!railway][traffic_sign !~ /^((.*;)?maxspeed(;.*)?|[A-Z][A-Z]:.+)$/][type != enforcement][waterway !~ /^(river|canal|lock)$/][!traffic_calming][aerialway!=zip_line] {
|
|---|
| 348 | throwWarning: tr("{0} on suspicious object", "{0.key}");
|
|---|
| 349 | group: tr("suspicious tag combination");
|
|---|
| 350 | }
|
|---|
| 351 |
|
|---|
| 352 | node[amenity][amenity =~ /^(restaurant|cafe|fast_food)$/][!name][noname!=yes] {
|
|---|
| 353 | throwOther: tr("{0} without {1}", "{0.tag}", "{2.key}");
|
|---|
| 354 | group: tr("missing tag");
|
|---|
| 355 | assertMatch: "node amenity=restaurant";
|
|---|
| 356 | assertNoMatch: "node amenity=restaurant noname=yes";
|
|---|
| 357 | assertNoMatch: "node amenity=restaurant name=Foobar";
|
|---|
| 358 | }
|
|---|
| 359 |
|
|---|
| 360 | /* #10193, #16157 */
|
|---|
| 361 | way[highway][barrier],
|
|---|
| 362 | *[highway][waterway][waterway!=dam][waterway!=weir],
|
|---|
| 363 | way[highway][natural][natural!=ridge],
|
|---|
| 364 | *[landuse][building][landuse!=retail] {
|
|---|
| 365 | throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
|
|---|
| 366 | group: tr("suspicious tag combination");
|
|---|
| 367 | assertNoMatch: "node highway=street_lamp natural=birds_nest";
|
|---|
| 368 | }
|
|---|
| 369 |
|
|---|
| 370 | /* #6932 */
|
|---|
| 371 | *[natural=water][leisure=swimming_pool] {
|
|---|
| 372 | throwWarning: tr("natural water used for swimming pool");
|
|---|
| 373 | group: tr("suspicious tag combination");
|
|---|
| 374 | fixRemove: "natural";
|
|---|
| 375 | }
|
|---|
| 376 |
|
|---|
| 377 | /* #9593, #11183, #12418, #12761 */
|
|---|
| 378 | *[sport][sport!=skiing][!building][!club][tourism != hotel][highway != raceway][!leisure][natural !~ /^(beach|bare_rock|cliff|peak|water)$/][amenity !~ /^(pub|restaurant|swimming_pool)$/][landuse !~ /^(recreation_ground|piste|farm|farmland)$/][barrier !~ /^(wall|retaining_wall)$/][!"piste:type"][shop!=sports] {
|
|---|
| 379 | throwWarning: tr("sport without physical feature");
|
|---|
| 380 | group: tr("missing tag");
|
|---|
| 381 | assertMatch: "node sport=tennis";
|
|---|
| 382 | assertNoMatch: "node sport=tennis leisure=pitch";
|
|---|
| 383 | assertNoMatch: "node sport=beachvolleyball natural=beach";
|
|---|
| 384 | assertNoMatch: "node sport=skiing"; /* skiing has deprecated warning */
|
|---|
| 385 | assertNoMatch: "node sport=swimming tourism=hotel";
|
|---|
| 386 | assertNoMatch: "node sport=10pin amenity=restaurant";
|
|---|
| 387 | }
|
|---|
| 388 |
|
|---|
| 389 | /* {0.key} without {1.key} or {2.key} see #10140 */
|
|---|
| 390 | *[building:levels][!building][!building:part],
|
|---|
| 391 | way[usage][!railway][!waterway][route!=railway][man_made!=pipeline] {
|
|---|
| 392 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
|
|---|
| 393 | group: tr("missing tag");
|
|---|
| 394 | }
|
|---|
| 395 |
|
|---|
| 396 | /* any other *_name tag (with some exceptions) but not a name , see #10837 #11297 #11539 #16437 */
|
|---|
| 397 | *[/_name$/][!name][!old_name][!loc_name][!uic_name][!artist_name][!lock_name][!"osak:municipality_name"][!"osak:street_name"][noname!=yes] {
|
|---|
| 398 | throwWarning: tr("alternative name without {0}", "{1.key}");
|
|---|
| 399 | group: tr("missing tag");
|
|---|
| 400 | }
|
|---|
| 401 |
|
|---|
| 402 | /* #10837 */
|
|---|
| 403 | way[destination][!oneway?][junction!=roundabout][highway] {
|
|---|
| 404 | throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
|
|---|
| 405 | suggestAlternative: "destination:forward";
|
|---|
| 406 | suggestAlternative: "destination:backward";
|
|---|
| 407 | }
|
|---|
| 408 |
|
|---|
| 409 | /* #11389 */
|
|---|
| 410 | way["maxspeed:forward"=*"maxspeed:backward"][!maxspeed] {
|
|---|
| 411 | throwWarning: tr("Same value of {0} and {1}", "{0.key}", "{1.key}");
|
|---|
| 412 | suggestAlternative: "maxspeed";
|
|---|
| 413 | group: tr("suspicious tag combination");
|
|---|
| 414 | fixChangeKey: "maxspeed:forward=>maxspeed";
|
|---|
| 415 | fixRemove: "maxspeed:backward";
|
|---|
| 416 | }
|
|---|
| 417 | way["maxspeed:forward"=*maxspeed]["maxspeed:backward"=*maxspeed][maxspeed] {
|
|---|
| 418 | throwWarning: tr("Same value of {0}, {1} and {2}", "{0.key}", "{1.key}", "{2.key}");
|
|---|
| 419 | set AllSameMaxspeed;
|
|---|
| 420 | suggestAlternative: "maxspeed";
|
|---|
| 421 | group: tr("suspicious tag combination");
|
|---|
| 422 | fixRemove: "maxspeed:forward";
|
|---|
| 423 | fixRemove: "maxspeed:backward";
|
|---|
| 424 | }
|
|---|
| 425 | way["maxspeed:forward"]["maxspeed:backward"][maxspeed]!.AllSameMaxspeed {
|
|---|
| 426 | throwWarning: tr("{0} and {1} together with {2} and conflicting values", "{0.key}", "{1.key}", "{2.key}");
|
|---|
| 427 | group: tr("suspicious tag combination");
|
|---|
| 428 | }
|
|---|
| 429 | way["maxspeed:forward"][maxspeed][!"maxspeed:backward"],
|
|---|
| 430 | way["maxspeed:backward"][maxspeed][!"maxspeed:forward"] {
|
|---|
| 431 | throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
|
|---|
| 432 | group: tr("suspicious tag combination");
|
|---|
| 433 | }
|
|---|
| 434 |
|
|---|
| 435 | /* #11837 */
|
|---|
| 436 | way[layer][layer<0][bridge][bridge!=no][location!=underground][indoor!=yes][!tunnel],
|
|---|
| 437 | way[layer][layer>0][tunnel][tunnel!=no][location!=overground][indoor!=yes][!bridge] {
|
|---|
| 438 | throwWarning: tr("{0} together with {1}", "{2.tag}", "{0.tag}");
|
|---|
| 439 | group: tr("suspicious tag combination");
|
|---|
| 440 | }
|
|---|
| 441 |
|
|---|
| 442 | /* #12942 */
|
|---|
| 443 | relation[oneway][type!=route] {
|
|---|
| 444 | throwWarning: tr("{0} on a relation without {1}", "{0.key}", "{1.tag}");
|
|---|
| 445 | }
|
|---|
| 446 |
|
|---|
| 447 | /* #9182 */
|
|---|
| 448 | way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) > 400] {
|
|---|
| 449 | 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}");
|
|---|
| 450 | group: tr("suspicious tag combination");
|
|---|
| 451 | }
|
|---|
| 452 | way[waterway][layer][layer=~/^(-1|-2|-3|-4|-5)$/][!tunnel][culvert!=yes][covered!=yes][pipeline!=yes][location!=underground][eval(waylength()) <= 400] {
|
|---|
| 453 | 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}");
|
|---|
| 454 | group: tr("suspicious tag combination");
|
|---|
| 455 | }
|
|---|
| 456 |
|
|---|
| 457 | /* #13144, #15536 */
|
|---|
| 458 | *[unisex=yes][female=yes][male!=yes][shop=hairdresser],
|
|---|
| 459 | *[unisex=yes][male=yes][female!=yes][shop=hairdresser] {
|
|---|
| 460 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 461 | group: tr("suspicious tag combination");
|
|---|
| 462 | }
|
|---|
| 463 | *[unisex=yes][female=yes][male=yes][shop=hairdresser] {
|
|---|
| 464 | throwWarning: tr("{0} together with {1} and {2}. Remove {1} and {2}", "{0.tag}", "{1.tag}", "{2.tag}");
|
|---|
| 465 | group: tr("suspicious tag combination");
|
|---|
| 466 | fixRemove: "female";
|
|---|
| 467 | fixRemove: "male";
|
|---|
| 468 | }
|
|---|
| 469 | *[female=yes][male=yes][!unisex][shop=hairdresser] {
|
|---|
| 470 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 471 | suggestAlternative: "unisex=yes";
|
|---|
| 472 | group: tr("suspicious tag combination");
|
|---|
| 473 | fixRemove: "female";
|
|---|
| 474 | fixRemove: "male";
|
|---|
| 475 | fixAdd: "unisex=yes";
|
|---|
| 476 | }
|
|---|
| 477 |
|
|---|
| 478 | /* {1.key} without {2.tag} see #13138, 14468 */
|
|---|
| 479 | area:closed[water][natural!~/water|bay|strait/][water!=intermittent] { /* water=intermittent is deprecated and has an own warning */
|
|---|
| 480 | throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
|
|---|
| 481 | group: tr("missing tag");
|
|---|
| 482 | }
|
|---|
| 483 | way!:closed[water][natural!~/water|bay|strait/][water!=intermittent] {
|
|---|
| 484 | throwWarning: tr("{0} without {1}", "{1.key}", "{2.tag}");
|
|---|
| 485 | group: tr("missing tag");
|
|---|
| 486 | }
|
|---|
| 487 |
|
|---|
| 488 | /* see #8519, #11529, limited to motorways and trunks to avoid false positives for streets with lanes for non motorized traffic */
|
|---|
| 489 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][turn:lanes ][tag(lanes)!=eval(count(split("|", tag("turn:lanes"))))],
|
|---|
| 490 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][change:lanes ][tag(lanes)!=eval(count(split("|", tag("change:lanes"))))],
|
|---|
| 491 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][maxspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("maxspeed:lanes"))))],
|
|---|
| 492 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][minspeed:lanes ][tag(lanes)!=eval(count(split("|", tag("minspeed:lanes"))))],
|
|---|
| 493 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:lanes"))))],
|
|---|
| 494 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:ref:lanes ][tag(lanes)!=eval(count(split("|", tag("destination:ref:lanes"))))],
|
|---|
| 495 | way[highway =~ /^(motorway|motorway_link|trunk|trunk_link)$/][lanes][destination:symbol:lanes][tag(lanes)!=eval(count(split("|", tag("destination:symbol:lanes"))))] {
|
|---|
| 496 | throwWarning: tr("Different number of lanes in the keys {0} and {1}", "{1.key}", "{2.key}");
|
|---|
| 497 | group: tr("suspicious tag combination");
|
|---|
| 498 | }
|
|---|
| 499 |
|
|---|
| 500 | /* #13680 */
|
|---|
| 501 | area[golf=bunker][natural=beach] {
|
|---|
| 502 | throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
|
|---|
| 503 | suggestAlternative: "natural=sand";
|
|---|
| 504 | suggestAlternative: "surface=sand";
|
|---|
| 505 | group: tr("suspicious tag combination");
|
|---|
| 506 | }
|
|---|
| 507 |
|
|---|
| 508 | /* #13705 */
|
|---|
| 509 | relation[type=multipolygon][building] > way {
|
|---|
| 510 | set part_of_building_MP;
|
|---|
| 511 | }
|
|---|
| 512 | way["addr:housenumber"][!building][!"building:part"][!"demolished:building"][!note][!amenity][!leisure][!landuse][!man_made][!tourism][!barrier]!.part_of_building_MP {
|
|---|
| 513 | /* don't exclude shop because a lot of real missing bulding tag cases have a shop tag. */
|
|---|
| 514 | throwOther: tr("possibly missing {0} tag", "{1.key}");
|
|---|
| 515 | group: tr("missing tag");
|
|---|
| 516 | }
|
|---|
| 517 |
|
|---|
| 518 | /* #14125, #14323 */
|
|---|
| 519 | way[highway][lanes][!lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1][junction!=roundabout][lanes>2][get(split(".", tag(lanes)/2), 1)=5] {
|
|---|
| 520 | throwWarning: tr("street with odd number of {0}, but without {1} and {2} or {3}", "{1.key}", "{2.key}", "{3.key}", "{4.key}");
|
|---|
| 521 | group: tr("missing tag");
|
|---|
| 522 | assertNoMatch: "way highway=primary lanes=2";
|
|---|
| 523 | assertNoMatch: "way highway=primary lanes=3 lanes:backward=2";
|
|---|
| 524 | assertNoMatch: "way highway=primary lanes=3 oneway=-1";
|
|---|
| 525 | assertNoMatch: "way highway=primary lanes=4";
|
|---|
| 526 | assertMatch: "way highway=primary lanes=3";
|
|---|
| 527 | }
|
|---|