[6548] | 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 |
|
---|
[7229] | 5 | /* {0.key} without {1.key} (warning level) */
|
---|
[7906] | 6 | way[junction ][!highway][junction!=yes],
|
---|
[6548] | 7 | *[lanes ][!highway],
|
---|
| 8 | *[lcn ][!highway],
|
---|
| 9 | *[living_street ][!highway],
|
---|
| 10 | *[maintenance ][!highway],
|
---|
| 11 | *[median ][!highway],
|
---|
| 12 | *[motorroad ][!highway],
|
---|
| 13 | *[ntd_id ][!highway],
|
---|
| 14 | *[sac_scale ][!highway],
|
---|
| 15 | *[sidewalk ][!highway],
|
---|
| 16 | *[smoothness ][!highway],
|
---|
| 17 | *[step_count ][!highway],
|
---|
| 18 | *[tracktype ][!highway],
|
---|
| 19 | *[trail_visibility ][!highway],
|
---|
| 20 | *[trolley_wire ][!highway],
|
---|
| 21 | *[zip_left ][!highway],
|
---|
| 22 | *[zip_right ][!highway],
|
---|
[6812] | 23 | *[detail ][!railway][route!=railway],
|
---|
| 24 | *[eddy_current_brake ][!railway][route!=railway],
|
---|
| 25 | *[electrified ][!railway][route!=railway],
|
---|
| 26 | *[etcs ][!railway][route!=railway],
|
---|
| 27 | *[gauge ][!railway][route!=railway],
|
---|
| 28 | *[grade_of_track ][!railway][route!=railway],
|
---|
| 29 | *[kursbuchstrecke ][!railway][route!=railway],
|
---|
| 30 | *[lzb ][!railway][route!=railway],
|
---|
| 31 | *[old_railway_operator ][!railway][route!=railway],
|
---|
| 32 | *[operating_procedure ][!railway][route!=railway],
|
---|
| 33 | *[pzb ][!railway][route!=railway],
|
---|
| 34 | *[radio ][!railway][route!=railway],
|
---|
| 35 | *[structure_gauge ][!railway][route!=railway],
|
---|
| 36 | *[tilting_technology ][!railway][route!=railway],
|
---|
| 37 | *[track_class ][!railway][route!=railway],
|
---|
| 38 | *[tracks ][!railway][route!=railway],
|
---|
| 39 | *[traffic_mode ][!railway][route!=railway],
|
---|
| 40 | *[usage ][!railway][route!=railway],
|
---|
| 41 | *[workrules ][!railway][route!=railway],
|
---|
[6548] | 42 | *[stream ][!waterway],
|
---|
| 43 | *[length_unit ][!waterway],
|
---|
| 44 | *[llid ][!waterway],
|
---|
| 45 | *[canal ][!waterway],
|
---|
| 46 | *[have_riverbank ][!waterway],
|
---|
| 47 | *[border_type ][!boundary],
|
---|
[7490] | 48 | *[bridge:structure ][!bridge],
|
---|
[6548] | 49 | *[source:date ][!source],
|
---|
| 50 | *[source:name ][!name],
|
---|
| 51 | *[source:maxspeed:forward ][!maxspeed:forward],
|
---|
| 52 | *[source:maxspeed:backward ][!maxspeed:backward],
|
---|
| 53 | *[source:maxspeed:forward ][!source:maxspeed:backward],
|
---|
| 54 | *[source:maxspeed:backward ][!source:maxspeed:forward],
|
---|
| 55 | *[source:building ][!building],
|
---|
| 56 | *[source:ref ][!ref],
|
---|
| 57 | *[source:population ][!population],
|
---|
| 58 | *[source:postal_code ][!postal_code],
|
---|
| 59 | *[source:ele ][!ele],
|
---|
| 60 | *[source:ref:INSEE ][!ref:INSEE],
|
---|
| 61 | *[source:lit ][!lit],
|
---|
| 62 | *[source:hgv ][!hgv],
|
---|
| 63 | *[source:highway ][!highway],
|
---|
| 64 | *[source:maxaxleload ][!maxaxleload],
|
---|
| 65 | *[source:surface ][!surface],
|
---|
| 66 | *[source:bridge ][!bridge],
|
---|
| 67 | *[source:old_name ][!old_name],
|
---|
| 68 | *[source:bicycle ][!bicycle],
|
---|
| 69 | *[source:designation ][!designation],
|
---|
| 70 | *[source:height ][!height],
|
---|
| 71 | *[source:lanes ][!lanes],
|
---|
[6645] | 72 | *[source:postcode ][!addr:postcode],
|
---|
| 73 | *[source:housenumber ][!addr:housenumber],
|
---|
| 74 | *[source:addr:postcode ][!addr:postcode],
|
---|
| 75 | *[source:addr:housenumber ][!addr:housenumber],
|
---|
[6548] | 76 | *[source:addr ][!/^addr:/],
|
---|
| 77 | *[source:maxspeed ][!/^maxspeed:?/] {
|
---|
| 78 | throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
|
---|
| 79 | assertMatch: "way lanes=42";
|
---|
| 80 | assertNoMatch: "way lanes=42 highway=unclassified";
|
---|
| 81 | assertMatch: "node source:addr:postcode=postman";
|
---|
| 82 | assertMatch: "node source:addr=postman";
|
---|
| 83 | assertNoMatch: "node source:addr=postman addr:housenumber=42";
|
---|
| 84 | }
|
---|
| 85 |
|
---|
[7229] | 86 | /* {0.key} without {1.key} (info level) */
|
---|
| 87 | *[leaf_type ][!leaf_cycle],
|
---|
| 88 | *[leaf_cycle][!leaf_type] {
|
---|
| 89 | throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
|
---|
| 90 | }
|
---|
| 91 |
|
---|
[6548] | 92 | /* {0.key} without {1.tag} */
|
---|
| 93 | *[fence_type ][barrier!=fence],
|
---|
| 94 | *[recycling_type ][amenity!=recycling],
|
---|
| 95 | *[board_type ][information!=board],
|
---|
| 96 | *[shelter_type ][amenity!=shelter],
|
---|
| 97 | *[lamp_type ][highway!=street_lamp],
|
---|
| 98 | *[map_type ][information!=map],
|
---|
| 99 | *[site_type ][historic!=archaeological_site],
|
---|
| 100 | *[artwork_type ][tourism!=artwork],
|
---|
| 101 | *[castle_type ][historic!=castle],
|
---|
| 102 | *[reservoir_type ][landuse!=reservoir][water!=reservoir],
|
---|
[7490] | 103 | *[bridge:movable ][bridge!=movable],
|
---|
[6548] | 104 | *[bunker_type ][military!=bunker] {
|
---|
| 105 | throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
|
---|
| 106 | }
|
---|
| 107 |
|
---|
[7923] | 108 | /* {0.tag} without {1.key} */
|
---|
| 109 | *[aeroway=terminal][!building] {
|
---|
| 110 | throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
|
---|
| 111 | }
|
---|
| 112 |
|
---|
[6548] | 113 | /* {0.key} without {1.key} or {2.key} */
|
---|
| 114 | *[incline ][!highway][!railway],
|
---|
| 115 | *[oneway ][!highway][!railway] {
|
---|
| 116 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
|
---|
| 117 | }
|
---|
| 118 |
|
---|
| 119 | /* {0.key} without {1.key} or {2.tag} */
|
---|
[7286] | 120 | *[segregated ][!highway][railway!=crossing],
|
---|
[6758] | 121 | *[boat ][!waterway][natural!=water],
|
---|
| 122 | *[intermittent ][!waterway][natural!=water] {
|
---|
[6548] | 123 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
|
---|
| 124 | }
|
---|
| 125 |
|
---|
[7920] | 126 | /* {0.key} without {1.tag}, {2.tag} or {3.tag} */
|
---|
[7919] | 127 | *[parking ][amenity!=parking][amenity!=parking_entrance][amenity!=motorcycle_parking] {
|
---|
[7920] | 128 | throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.tag}", "{2.tag}", "{3.tag}");
|
---|
[7767] | 129 | }
|
---|
| 130 |
|
---|
[6880] | 131 | /* {0.key} without {1.key}, {2.key} or {3.key} */
|
---|
| 132 | *[snowplowing ][!highway][!amenity][!leisure] {
|
---|
| 133 | throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
|
---|
| 134 | }
|
---|
| 135 |
|
---|
[7250] | 136 | /* {0.key} without {1.key}, {2.key} or {3.tag} */
|
---|
| 137 | *[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
|
---|
| 138 | throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
|
---|
| 139 | }
|
---|
| 140 |
|
---|
[7818] | 141 | /* {0.key} together with {1.key}, see #10837 */
|
---|
| 142 | *[noname?][name],
|
---|
| 143 | *[highway]["addr:street"] {
|
---|
| 144 | throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
|
---|
| 145 | }
|
---|
| 146 |
|
---|
[6548] | 147 | /* {0} on suspicious object */
|
---|
| 148 | *[tunnel ][!highway][!railway][!waterway][public_transport != platform][man_made != pipeline],
|
---|
| 149 | *[bridge ][!highway][!railway][!waterway][!piste:type][public_transport != platform][man_made !~ /^(bridge|pipeline)$/][building != bridge],
|
---|
| 150 | *[psv ][!highway][!railway][!waterway][amenity !~ /^parking.*/],
|
---|
| 151 | *[width ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance],
|
---|
[7032] | 152 | *[maxspeed][!highway][!railway][traffic_sign !~ /^(.*;)?maxspeed(;.*)?$/][type != enforcement][waterway !~ /^(river|canal|lock)$/],
|
---|
[7727] | 153 | *[lit ][!highway][!railway][!piste:type][amenity !~ /^(parking|shelter)/][public_transport!=platform][advertising!=billboard][!leisure][!tourism] {
|
---|
[6548] | 154 | throwWarning: tr("{0} on suspicious object", "{0.key}");
|
---|
| 155 | }
|
---|
| 156 |
|
---|
| 157 | node[amenity =~ /^(restaurant|cafe|fast_food)$/][!name] {
|
---|
| 158 | throwOther: tr("restaurant without name");
|
---|
| 159 | assertMatch: "node amenity=restaurant";
|
---|
| 160 | assertNoMatch: "node amenity=restaurant name=Foobar";
|
---|
| 161 | }
|
---|
| 162 |
|
---|
[6550] | 163 | way[highway][barrier],
|
---|
[6548] | 164 | *[highway][waterway][waterway!=dam],
|
---|
[7265] | 165 | way[highway][natural],
|
---|
[6548] | 166 | *[landuse][building] {
|
---|
| 167 | throwWarning: tr("{0} used with {1}", "{0.key}", "{1.key}");
|
---|
[7265] | 168 | assertNoMatch: "node highway=street_lamp natural=birds_nest note=josm#10193";
|
---|
[6548] | 169 | }
|
---|
| 170 |
|
---|
| 171 | *[natural=water][leisure=swimming_pool],
|
---|
| 172 | *[natural=water][amenity=swimming_pool] {
|
---|
| 173 | /* see #6932 */
|
---|
| 174 | throwWarning: tr("natural water used for swimming pool");
|
---|
[7274] | 175 | fixRemove: "natural";
|
---|
[6548] | 176 | }
|
---|
[6860] | 177 |
|
---|
[7818] | 178 | /* see #9593 */
|
---|
[7925] | 179 | *[sport][!building][tourism != hotel][highway != raceway][leisure !~ /^(sports_centre|stadium|track|pitch|golf_course|water_park|swimming_pool|recreation_ground)$/][natural !~ /^(beach|bare_rock|peak)$/][amenity !~ /^(pub|restaurant|swimming_pool)$/][landuse !~ /^(recreation_ground|piste|farm|farmland)$/] {
|
---|
[6860] | 180 | throwWarning: tr("sport without physical feature");
|
---|
| 181 | assertMatch: "node sport=tennis";
|
---|
| 182 | assertNoMatch: "node sport=tennis leisure=pitch";
|
---|
| 183 | assertNoMatch: "node sport=beachvolleyball natural=beach";
|
---|
| 184 | assertNoMatch: "node sport=skiiing landuse=piste";
|
---|
| 185 | assertNoMatch: "node sport=swimming tourism=hotel";
|
---|
| 186 | assertNoMatch: "node sport=10pin amenity=restaurant";
|
---|
[7243] | 187 | }
|
---|
| 188 |
|
---|
| 189 | /* see #10140 */
|
---|
| 190 | *[building:levels][!building][!building:part] {
|
---|
| 191 | throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
|
---|
| 192 | }
|
---|
[7488] | 193 |
|
---|
| 194 | /* see #10471 */
|
---|
| 195 | way[waterway] > node[ford?] { set ford_on_waterway; }
|
---|
| 196 | way[highway] > node[ford?] { set ford_on_highway; }
|
---|
| 197 | node[ford?]!.ford_on_waterway, node[ford?]!.ford_on_highway {
|
---|
| 198 | throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
|
---|
| 199 | }
|
---|
[7818] | 200 |
|
---|
[7872] | 201 | /* any other *_name tag (except old_name, loc_name and uic_name) but not a name , see #10837 */
|
---|
| 202 | *[/_name$/][!name][!old_name][!loc_name][!uic_name] {
|
---|
[7818] | 203 | throwWarning: tr("alternative name without {0}", "{1.key}");
|
---|
| 204 | }
|
---|
| 205 |
|
---|
| 206 | /* see #10837 */
|
---|
| 207 | way[destination][!oneway?] {
|
---|
| 208 | throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
|
---|
| 209 | suggestAlternative: "destination:forward";
|
---|
| 210 | suggestAlternative: "destination:backward";
|
---|
| 211 | }
|
---|