source: josm/trunk/data/validator/combinations.mapcss@ 8043

Last change on this file since 8043 was 8043, checked in by Klumbumbus, 9 years ago

fix #9811 - add validator warning for addr:*=* together with highway, place or boundary

  • Property svn:eol-style set to native
File size: 10.8 KB
RevLine 
[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]6way[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*[step_count ][!highway],
17*[tracktype ][!highway],
18*[trail_visibility ][!highway],
19*[trolley_wire ][!highway],
20*[zip_left ][!highway],
21*[zip_right ][!highway],
[6812]22*[detail ][!railway][route!=railway],
23*[eddy_current_brake ][!railway][route!=railway],
24*[electrified ][!railway][route!=railway],
25*[etcs ][!railway][route!=railway],
26*[gauge ][!railway][route!=railway],
27*[grade_of_track ][!railway][route!=railway],
28*[kursbuchstrecke ][!railway][route!=railway],
29*[lzb ][!railway][route!=railway],
30*[old_railway_operator ][!railway][route!=railway],
31*[operating_procedure ][!railway][route!=railway],
32*[pzb ][!railway][route!=railway],
33*[radio ][!railway][route!=railway],
34*[structure_gauge ][!railway][route!=railway],
35*[tilting_technology ][!railway][route!=railway],
36*[track_class ][!railway][route!=railway],
37*[tracks ][!railway][route!=railway],
38*[traffic_mode ][!railway][route!=railway],
39*[usage ][!railway][route!=railway],
40*[workrules ][!railway][route!=railway],
[6548]41*[stream ][!waterway],
42*[length_unit ][!waterway],
43*[llid ][!waterway],
44*[canal ][!waterway],
45*[have_riverbank ][!waterway],
46*[border_type ][!boundary],
[7490]47*[bridge:structure ][!bridge],
[6548]48*[source:date ][!source],
49*[source:name ][!name],
50*[source:maxspeed:forward ][!maxspeed:forward],
51*[source:maxspeed:backward ][!maxspeed:backward],
52*[source:maxspeed:forward ][!source:maxspeed:backward],
53*[source:maxspeed:backward ][!source:maxspeed:forward],
54*[source:building ][!building],
55*[source:ref ][!ref],
56*[source:population ][!population],
57*[source:postal_code ][!postal_code],
58*[source:ele ][!ele],
59*[source:ref:INSEE ][!ref:INSEE],
60*[source:lit ][!lit],
61*[source:hgv ][!hgv],
62*[source:highway ][!highway],
63*[source:maxaxleload ][!maxaxleload],
64*[source:surface ][!surface],
65*[source:bridge ][!bridge],
66*[source:old_name ][!old_name],
67*[source:bicycle ][!bicycle],
68*[source:designation ][!designation],
69*[source:height ][!height],
70*[source:lanes ][!lanes],
[6645]71*[source:postcode ][!addr:postcode],
72*[source:housenumber ][!addr:housenumber],
73*[source:addr:postcode ][!addr:postcode],
74*[source:addr:housenumber ][!addr:housenumber],
[6548]75*[source:addr ][!/^addr:/],
76*[source:maxspeed ][!/^maxspeed:?/] {
77 throwWarning: tr("{0} without {1}", "{0.key}", "{1.key}");
78 assertMatch: "way lanes=42";
79 assertNoMatch: "way lanes=42 highway=unclassified";
80 assertMatch: "node source:addr:postcode=postman";
81 assertMatch: "node source:addr=postman";
82 assertNoMatch: "node source:addr=postman addr:housenumber=42";
83}
84
[7229]85/* {0.key} without {1.key} (info level) */
86*[leaf_type ][!leaf_cycle],
87*[leaf_cycle][!leaf_type] {
88 throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
89}
90
[6548]91/* {0.key} without {1.tag} */
92*[fence_type ][barrier!=fence],
93*[recycling_type ][amenity!=recycling],
[7996]94*[information ][tourism!=information],
[6548]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} */
[7996]109*[tourism=information][!information],
[7929]110*[aeroway=terminal][!building],
[7967]111*[power=generator][!generator:source],
[7929]112*[amenity=place_of_worship][!religion] {
[7923]113 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
114}
115
[6548]116/* {0.key} without {1.key} or {2.key} */
117*[incline ][!highway][!railway],
118*[oneway ][!highway][!railway] {
119 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
120}
121
122/* {0.key} without {1.key} or {2.tag} */
[8039]123*[smoothness ][!highway][amenity!=parking][amenity!=parking_space][amenity!=parking_entrance][amenity!=motorcycle_parking],
[7286]124*[segregated ][!highway][railway!=crossing],
[6758]125*[boat ][!waterway][natural!=water],
126*[intermittent ][!waterway][natural!=water] {
[6548]127 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
128}
129
[7920]130/* {0.key} without {1.tag}, {2.tag} or {3.tag} */
[7919]131*[parking ][amenity!=parking][amenity!=parking_entrance][amenity!=motorcycle_parking] {
[7920]132 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.tag}", "{2.tag}", "{3.tag}");
[7767]133}
134
[6880]135/* {0.key} without {1.key}, {2.key} or {3.key} */
136*[snowplowing ][!highway][!amenity][!leisure] {
137 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
138}
139
[7250]140/* {0.key} without {1.key}, {2.key} or {3.tag} */
141*[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
142 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
143}
144
[7818]145/* {0.key} together with {1.key}, see #10837 */
[8043]146*[noname?][name] {
[7818]147 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
148}
149
[8043]150/* see #9811 */
151*[place][/^addr:/],
152*[boundary][/^addr:/],
153*[highway][/^addr:/] {
154 throwWarning: tr("{0} together with addr:*", "{0.key}");
155}
156
[8042]157/* see #9195 */
158*[highway=footway][cycleway=lane] {
159 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
160 suggestAlternative: "bicycle=designated + segregated=yes";
161}
162
[6548]163/* {0} on suspicious object */
164*[tunnel ][!highway][!railway][!waterway][public_transport != platform][man_made != pipeline],
165*[bridge ][!highway][!railway][!waterway][!piste:type][public_transport != platform][man_made !~ /^(bridge|pipeline)$/][building != bridge],
166*[psv ][!highway][!railway][!waterway][amenity !~ /^parking.*/],
167*[width ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance],
[7032]168*[maxspeed][!highway][!railway][traffic_sign !~ /^(.*;)?maxspeed(;.*)?$/][type != enforcement][waterway !~ /^(river|canal|lock)$/],
[7727]169*[lit ][!highway][!railway][!piste:type][amenity !~ /^(parking|shelter)/][public_transport!=platform][advertising!=billboard][!leisure][!tourism] {
[6548]170 throwWarning: tr("{0} on suspicious object", "{0.key}");
171}
172
[7932]173node[amenity =~ /^(restaurant|cafe|fast_food)$/][!name][noname!=yes] {
[6548]174 throwOther: tr("restaurant without name");
175 assertMatch: "node amenity=restaurant";
[7932]176 assertNoMatch: "node amenity=restaurant noname=yes";
[6548]177 assertNoMatch: "node amenity=restaurant name=Foobar";
178}
179
[6550]180way[highway][barrier],
[6548]181*[highway][waterway][waterway!=dam],
[7265]182way[highway][natural],
[6548]183*[landuse][building] {
184 throwWarning: tr("{0} used with {1}", "{0.key}", "{1.key}");
[7265]185 assertNoMatch: "node highway=street_lamp natural=birds_nest note=josm#10193";
[6548]186}
187
188*[natural=water][leisure=swimming_pool],
189*[natural=water][amenity=swimming_pool] {
190 /* see #6932 */
191 throwWarning: tr("natural water used for swimming pool");
[7274]192 fixRemove: "natural";
[6548]193}
[6860]194
[7818]195/* see #9593 */
[7925]196*[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]197 throwWarning: tr("sport without physical feature");
198 assertMatch: "node sport=tennis";
199 assertNoMatch: "node sport=tennis leisure=pitch";
200 assertNoMatch: "node sport=beachvolleyball natural=beach";
201 assertNoMatch: "node sport=skiiing landuse=piste";
202 assertNoMatch: "node sport=swimming tourism=hotel";
203 assertNoMatch: "node sport=10pin amenity=restaurant";
[7243]204}
205
206/* see #10140 */
207*[building:levels][!building][!building:part] {
208 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
209}
[7488]210
211/* see #10471 */
212way[waterway] > node[ford?] { set ford_on_waterway; }
213way[highway] > node[ford?] { set ford_on_highway; }
214node[ford?]!.ford_on_waterway, node[ford?]!.ford_on_highway {
215 throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
216}
[7818]217
[7872]218/* any other *_name tag (except old_name, loc_name and uic_name) but not a name , see #10837 */
219*[/_name$/][!name][!old_name][!loc_name][!uic_name] {
[7818]220 throwWarning: tr("alternative name without {0}", "{1.key}");
221}
222
223/* see #10837 */
224way[destination][!oneway?] {
225 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
226 suggestAlternative: "destination:forward";
227 suggestAlternative: "destination:backward";
228}
Note: See TracBrowser for help on using the repository browser.