source: josm/trunk/data/validator/unnecessary.mapcss @ 14918

Last change on this file since 14918 was 14918, checked in by Don-vip, 18 months ago

fix #9257 - detect highway=footway, highway=pedestrian with foot=yes (and highway=cycleway with bicycle=yes) (PATCH by mkoniecz)

  • Property svn:eol-style set to native
File size: 5.9 KB
Line 
1*[access][highway=proposed],
2*[motor_vehicle?][!vehicle][!access][bicycle_road!=yes][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link|unclassified|residential|service|living_street)$/],
3*[bridge=no],
4*[building=no],
5*[elevation="0"],
6*[layer="0"] {
7  /* see #9365 - Useless tag layer=0 */
8  throwWarning: tr("{0} is unnecessary", "{0.tag}");
9  group: tr("unnecessary tag");
10  fixRemove: "{0.key}";
11  assertMatch: "way layer=0";
12  assertMatch: "way bridge=no";
13  assertMatch: "way highway=proposed access=no";
14  assertMatch: "way highway=motorway motor_vehicle=yes";
15  assertNoMatch: "way highway=motorway access=no motor_vehicle=yes";
16}
17
18area:closed[amenity ][area?][!highway],
19area:closed[building][area?],
20area:closed[landuse ][area?][!highway],
21area:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway],
22area:closed[natural ][area?],
23area:closed[shop    ][area?] {
24  throwWarning: tr("{0} is unnecessary for {1}", "{2.key}", "{1.key}");
25  group: tr("unnecessary tag");
26  fixRemove: "{2.key}";
27}
28
29/* #14256, #15664 */
30area:closed[highway=rest_area][area?],
31area:closed[highway=services][area?],
32area:closed[aeroway=aerodrome][area?],
33area:closed[aeroway=helipad][area?] {
34  throwWarning: tr("{0} is unnecessary for {1}", "{2.key}", "{1.tag}");
35  group: tr("unnecessary tag");
36  fixRemove: "{2.key}";
37}
38
39/* #9257, #17482 */
40way[foot =~ /^(yes|designated)$/][!access][highway =~ /^(footway|pedestrian)$/],
41way[bicycle =~ /^(yes|designated)$/][!vehicle][!access][highway=cycleway],
42*[building:ruian:type=2][building=farm_auxiliary],
43*[building:ruian:type=7][building=house],
44*[building:ruian:type=11][building=hotel],
45*[building:ruian:type=12][building=warehouse],
46*[building:ruian:type=13][building=barn],
47*[building:ruian:type=18][building=garage],
48*[building:ruian:type=21][building=greenhouse] {
49  throwWarning: tr("{0} is unnecessary for {1}", "{0.tag}", "{1.tag}");
50  group: tr("unnecessary tag");
51  fixRemove: "{0.key}";
52  assertMatch: "way highway=pedestrian foot=designated";
53  assertNoMatch: "way highway=pedestrian access=no foot=designated";
54}
55
56*[emergency=permissive] {
57  /* see #9458 - emergency=permissive makes no sense */
58  throwWarning: tr("{0} makes no sense", "{0.tag");
59  fixAdd: "emergency=yes";
60  assertMatch: "way emergency=permissive";
61  assertNoMatch: "way emergency=designated";
62}
63
64/* see ticket #7639 -- Warn when a node has the same tags as its parent way. */
65way >:sameTags node:tagged {
66  throwWarning: tr("Nodes duplicating parent way tags");
67}
68
69/* #15477 */
70*[payment:cash][payment:coins][payment:notes] {
71  throwWarning: tr("{0} together with {1} and {2}. Remove {0}.", "{0.key}", "{1.key}", "{2.key}");
72  group: tr("unnecessary tag");
73  fixRemove: "payment:cash";
74}
75
76/* see #10346, #15667 */
77way[waterway][oneway?] {
78  throwWarning: tr("{0} is unnecessary for {1}", "{1.key}", "{0.key}");
79  group: tr("unnecessary tag");
80  fixRemove: "{1.key}";
81}
82way[waterway][oneway=-1] {
83  throwWarning: tr("{0} is unnecessary for {1}. The flow direction is defined by the way direction.", "{1.key}", "{0.key}");
84  group: tr("unnecessary tag");
85}
86
87/* #15774 */
88node[emergency=fire_hydrant][fire_hydrant:count=1] {
89  throwWarning: tr("{0} is unnecessary for {1}", "{1.tag}", "{0.tag}");
90  group: tr("unnecessary tag");
91  fixRemove: "{1.key}";
92}
93
94/* #17100, #17471 */
95*[name][name=~/^(?i)(parking|parkplatz)$/][amenity=parking],
96*[name][name=~/^(?i)(playground|spielplatz)$/][leisure=playground],
97*[name][name=~/^(?i)(shop)$/][shop][shop!=no],
98*[name][name=~/^(?i)(building)$/][building][building!=no],
99*[name][name=~/^(?i)(house|rumah)$/][building=house],
100*[name][name=~/^(?i)(kiosk)$/][shop=kiosk],
101*[name][name=~/^(?i)(jalan)$/][highway],
102*[name][name=~/^(?i)(silo)$/][man_made=silo],
103*[name][name=~/^(?i)(silo)$/][building=silo],
104*[name][name=~/^(?i)(cemetery|cmentarz)$/][amenity=graveyard],
105*[name][name=~/^(?i)(cemetery|cmentarz)$/][amenity=cemetery],
106*[name="АЗС"][amenity=fuel] {
107  throwWarning: tr("{0}", "{0.tag}");
108  group: tr("descriptive name");
109  fixRemove: "name";
110  assertMatch: "node name=parking amenity=parking";
111  assertMatch: "node name=Parking amenity=parking";
112  assertNoMatch: "node name=Parking_with_suffix amenity=parking";
113  assertNoMatch: "node name=Megaparking amenity=parking";
114  assertMatch: "relation name=parking amenity=parking type=multipolygon";
115  assertMatch: "relation name=Parking amenity=parking type=multipolygon";
116  assertNoMatch: "way name=parking";
117  assertMatch: "relation name=PLAYGROUND leisure=playground type=multipolygon";
118  assertMatch: "node name=PLaYGrOUNd leisure=playground";
119  assertMatch: "node name=shop shop=whatever";
120  assertNoMatch: "node name=shop shop=no";
121  assertNoMatch: "way name=shop leisure=playground";
122  assertMatch: "way name=building building=yes";
123  assertMatch: "way name=building building=house";
124  assertMatch: "way name=Rumah building=house";
125  assertNoMatch: "way name=Rumah building=yes";
126  assertMatch: "way name=house building=house";
127  assertNoMatch: "way name=house building=yes";
128  assertMatch: "way name=kiosk building=yes shop=kiosk";
129  assertNoMatch: "way name=kiosk building=yes";
130  assertMatch: "way name=silo man_made=silo";
131  assertMatch: "way name=Silo man_made=silo building=silo";
132  assertMatch: "way name=Silo building=silo";
133  assertMatch: "way name=cemetery amenity=graveyard";
134  assertMatch: "way name=Cmentarz amenity=graveyard";
135  assertNoMatch: "way name=kiosk amenity=graveyard";
136} 
137*[name][name=~/^(?i)(house|rumah)$/][building][building!=house][building!=no] {
138  throwWarning: tr("{0}", "{0.tag}");
139  group: tr("descriptive name");
140  /* without fixRemove to avoid possible information loss */
141  assertNoMatch: "way name=building building=yes";
142  assertNoMatch: "way name=building building=house";
143  assertNoMatch: "way name=Rumah building=house";
144  assertMatch: "way name=Rumah building=yes";
145  assertNoMatch: "way name=house building=house";
146  assertMatch: "way name=house building=yes";
147}
Note: See TracBrowser for help on using the repository browser.