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

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

see #11183 - update validator for sport without physical feature

  • Property svn:eol-style set to native
File size: 12.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
5/* {0.key} without {1.key} (warning level) */
6way[junction ][!highway][junction!=yes],
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],
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],
41*[stream ][!waterway],
42*[length_unit ][!waterway],
43*[llid ][!waterway],
44*[canal ][!waterway],
45*[have_riverbank ][!waterway],
46*[border_type ][!boundary],
47*[bridge:structure ][!bridge],
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],
71*[source:postcode ][!addr:postcode],
72*[source:housenumber ][!addr:housenumber],
73*[source:addr:postcode ][!addr:postcode],
74*[source:addr:housenumber ][!addr:housenumber],
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
85/* {0.key} without {1.key} (info level) */
86*[lanes:forward][!lanes:backward][oneway!=yes][oneway!=-1],
87*[lanes:backward][!lanes:forward][oneway!=yes][oneway!=-1],
88*[leaf_type ][!leaf_cycle],
89*[leaf_cycle][!leaf_type] {
90 throwOther: tr("{0} without {1}", "{0.key}", "{1.key}");
91}
92
93/* {0.key} without {1.tag} */
94*[fence_type ][barrier!=fence],
95*[recycling_type ][amenity!=recycling],
96*[information ][tourism!=information],
97*[board_type ][information!=board],
98*[shelter_type ][amenity!=shelter],
99*[lamp_type ][highway!=street_lamp],
100*[map_type ][information!=map],
101*[site_type ][historic!=archaeological_site],
102*[artwork_type ][tourism!=artwork],
103*[castle_type ][historic!=castle],
104*[reservoir_type ][landuse!=reservoir][water!=reservoir],
105*[bridge:movable ][bridge!=movable],
106*[parking ][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/]
107*[bunker_type ][military!=bunker] {
108 throwWarning: tr("{0} without {1}", "{0.key}", "{1.tag}");
109}
110
111/* {0.tag} without {1.key} (warning level) */
112*[tourism=information][!information],
113*[aeroway=terminal][!building],
114*[power=generator][!generator:source],
115*[amenity=place_of_worship][!religion] {
116 throwWarning: tr("{0} without {1}", "{0.tag}", "{1.key}");
117}
118
119/* {0.tag} without {1.key} (info level) */
120*[amenity=parking ][!parking],
121*[amenity=parking_entrance ][!parking] {
122 throwOther: tr("{0} without {1}", "{0.tag}", "{1.key}");
123}
124
125/* {0.key} without {1.key} or {2.key} */
126*[incline ][!highway][!railway],
127*[oneway ][!highway][!railway] {
128 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
129}
130
131/* {0.key} without {1.key} or {2.tag} */
132*[smoothness ][!highway][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking)$/],
133*[segregated ][!highway][railway!=crossing],
134*[boat ][!waterway][natural!=water] {
135 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.tag}");
136}
137
138/* {0.key} without {1.key}, {2.tag} or {3.tag} */
139*[intermittent ][!waterway][natural!~/^(water|spring)$/][ford!=yes] {
140 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.tag}", "{3.tag}");
141}
142
143/* {0.key} without {1.key}, {2.key} or {3.key} */
144*[snowplowing ][!highway][!amenity][!leisure] {
145 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.key}");
146}
147
148/* {0.key} without {1.key}, {2.key} or {3.tag} */
149*[toll ][!highway][!barrier][route!~/^(ferry|road)$/] {
150 throwWarning: tr("{0} without {1}, {2} or {3}", "{0.key}", "{1.key}", "{2.key}", "{3.tag}");
151}
152
153/* {0.key} together with {1.key}, see #10837 */
154*[noname?][name] {
155 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.key}");
156}
157
158/* {0.tag} together with {1.key}, see #9389 */
159*[oneway=yes][/:backward/],
160*[oneway=yes][/:forward/],
161*[oneway=-1 ][/:backward/],
162*[oneway=-1 ][/:forward/] {
163 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.key}");
164}
165
166/* {0.tag} together with {1.tag} (info level), see #9696 */
167*[highway=footway][oneway=no] {
168 throwOther: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
169}
170
171/* {0.tag} together with {1.tag}, see #10186 */
172*[highway=footway][bicycle=designated] {
173 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
174}
175
176/*see #11127*/
177way[waterway][bridge=yes] {
178 throwWarning: tr("{0} together with {1}", "{0.key}", "{1.tag}");
179 suggestAlternative: "bridge=aqueduct";
180 fixAdd: "bridge=aqueduct";
181}
182
183/* only {0.key}, see #11104 */
184*[area][eval(number_of_tags()) = 1],
185*[name][eval(number_of_tags()) = 1],
186*[ref][eval(number_of_tags()) = 1] {
187 throwWarning: tr("incomplete object: only {0}", "{0.key}");
188}
189/* only {0.key} and {1.key}, see #11104 */
190*[name][area][eval(number_of_tags()) = 2],
191*[name][ref][eval(number_of_tags()) = 2] {
192 throwWarning: tr("incomplete object: only {0} and {1}", "{0.key}", "{1.key}");
193}
194
195/* see #9811 */
196*[place][place!=farm][/^addr:/],
197*[boundary][/^addr:/],
198*[highway][/^addr:/] {
199 throwWarning: tr("{0} together with addr:*", "{0.key}");
200}
201
202/* see #9195 */
203*[highway=footway][cycleway=lane] {
204 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
205 suggestAlternative: "highway=path + foot=designated + bicycle=designated + segregated=yes";
206}
207
208/* {0} on suspicious object */
209*[tunnel ][!highway][!railway][!waterway][public_transport != platform][man_made != pipeline],
210*[bridge ][!highway][!railway][!waterway][!piste:type][public_transport != platform][man_made !~ /^(bridge|pipeline)$/][building != bridge],
211*[psv ][!highway][!railway][!waterway][amenity !~ /^parking.*/],
212*[width ][!highway][!railway][!waterway][!aeroway][!cycleway][!footway][!barrier][!man_made][!entrance],
213*[maxspeed][!highway][!railway][traffic_sign !~ /^(.*;)?maxspeed(;.*)?$/][type != enforcement][waterway !~ /^(river|canal|lock)$/],
214*[lit ][!highway][!railway][!piste:type][!amenity][public_transport!=platform][advertising!=billboard][!leisure][!tourism] {
215 throwWarning: tr("{0} on suspicious object", "{0.key}");
216}
217
218node[amenity =~ /^(restaurant|cafe|fast_food)$/][!name][noname!=yes] {
219 throwOther: tr("restaurant without name");
220 assertMatch: "node amenity=restaurant";
221 assertNoMatch: "node amenity=restaurant noname=yes";
222 assertNoMatch: "node amenity=restaurant name=Foobar";
223}
224
225way[highway][barrier],
226*[highway][waterway][waterway!=dam],
227way[highway][natural],
228*[landuse][building] {
229 throwWarning: tr("{0} used with {1}", "{0.key}", "{1.key}");
230 assertNoMatch: "node highway=street_lamp natural=birds_nest note=josm#10193";
231}
232
233*[natural=water][leisure=swimming_pool],
234*[natural=water][amenity=swimming_pool] {
235 /* see #6932 */
236 throwWarning: tr("natural water used for swimming pool");
237 fixRemove: "natural";
238}
239
240/* see #9593, #11183 */
241*[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)$/][barrier !~ /^(wall|retaining_wall)$/] {
242 throwWarning: tr("sport without physical feature");
243 assertMatch: "node sport=tennis";
244 assertNoMatch: "node sport=tennis leisure=pitch";
245 assertNoMatch: "node sport=beachvolleyball natural=beach";
246 assertNoMatch: "node sport=skiiing landuse=piste";
247 assertNoMatch: "node sport=swimming tourism=hotel";
248 assertNoMatch: "node sport=10pin amenity=restaurant";
249}
250
251/* see #10140 */
252*[building:levels][!building][!building:part] {
253 throwWarning: tr("{0} without {1} or {2}", "{0.key}", "{1.key}", "{2.key}");
254}
255
256/* see #10471 */
257way[waterway] > node[ford?] { set ford_on_waterway; }
258way[highway] > node[ford?] { set ford_on_highway; }
259node[ford?]!.ford_on_waterway, node[ford?]!.ford_on_highway {
260 throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
261}
262
263/* any other *_name tag (except old_name, loc_name and uic_name) but not a name , see #10837 */
264*[/_name$/][!name][!old_name][!loc_name][!uic_name] {
265 throwWarning: tr("alternative name without {0}", "{1.key}");
266}
267
268/* see #10837 */
269way[destination][!oneway?] {
270 throwWarning: tr("incomplete usage of {0} on a way without {1}", "{0.key}", "{1.key}");
271 suggestAlternative: "destination:forward";
272 suggestAlternative: "destination:backward";
273}
Note: See TracBrowser for help on using the repository browser.