source: josm/trunk/resources/data/validator/unnecessary.mapcss@ 18289

Last change on this file since 18289 was 18271, checked in by GerdP, 3 years ago

fix #20681: Unnecessary tag area=yes not reported for waterway=riverbank

  • add check for waterway=riverbank
  • change filter area to way to avoid duplicate warnings for relations with area=yes
  • Property svn:eol-style set to native
File size: 7.9 KB
Line 
1*[access][highway=proposed],
2*[bridge=no],
3*[building=no],
4*[elevation="0"],
5*[layer="0"] {
6 /* see #9365 - Useless tag layer=0 */
7 throwWarning: tr("{0} is unnecessary", "{0.tag}");
8 group: tr("unnecessary tag");
9 fixRemove: "{0.key}";
10 assertMatch: "way layer=0";
11 assertMatch: "way bridge=no";
12 assertMatch: "way highway=proposed access=no";
13}
14
15/* #19996 */
16*[motor_vehicle?][!vehicle][!access][bicycle_road!=yes][highway =~ /^(motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link|tertiary|tertiary_link)$/] {
17 throwOther: tr("{0} is optional on {1}", "{0.tag}", "{4.tag}");
18 assertMatch: "way highway=motorway motor_vehicle=yes";
19 assertNoMatch: "way highway=motorway access=no motor_vehicle=yes";
20}
21
22way:closed[amenity ][area?][!highway],
23way:closed[building][area?],
24way:closed[landuse ][area?][!highway],
25way:closed[leisure ][area?][!highway][leisure!=track][leisure!=slipway],
26way:closed[natural ][area?],
27way:closed[shop ][area?] {
28 throwWarning: tr("{0} is unnecessary for {1}", "{2.tag}", "{1.key}");
29 group: tr("unnecessary tag");
30 fixRemove: "{2.key}";
31}
32
33/* #14256, #15664, #20681 */
34way:closed[highway=rest_area][area?],
35way:closed[highway=services][area?],
36way:closed[aeroway=aerodrome][area?],
37way:closed[waterway=riverbank][area?],
38way:closed[aeroway=helipad][area?] {
39 throwWarning: tr("{0} is unnecessary for {1}", "{2.tag}", "{1.tag}");
40 group: tr("unnecessary tag");
41 fixRemove: "{2.key}";
42}
43
44*[gnis:Class="Populated Place"][place=city],
45*[gnis:Class="Populated Place"][place=town],
46*[gnis:Class="Populated Place"][place=village],
47*[gnis:Class="Populated Place"][place=hamlet],
48*[gnis:Class=Summit][natural=peak] {
49 throwWarning: tr("{0} is unnecessary for {1}", "{0.tag}", "{1.tag}");
50 group: tr("unnecessary tag");
51 fixRemove: "{0.key}";
52 assertMatch: "node gnis:Class=\"Populated Place\" place=village";
53 assertNoMatch: "node gnis:Class=\"Populated Place\" place=locality";
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/* #15774 */
77node[emergency=fire_hydrant][fire_hydrant:count=1] {
78 throwWarning: tr("{0} is unnecessary for {1}", "{1.tag}", "{0.tag}");
79 group: tr("unnecessary tag");
80 fixRemove: "{1.key}";
81}
82
83/* #17100, #17471, #17629, #17633, #19274, #19395, #19409 */
84*[name][name=~/^(?i)(library|biblioteca|biblioteka|bibliothek|bibliotheek)$/][amenity=library],
85*[name][name=~/^(?i)(parc|park)$/][leisure=park],
86*[name][name=~/^(?i)(pond)$/][water=pond],
87*[name][name=~/^(?i)(church|église|biserica)$/][amenity=place_of_worship][religion=christian],
88*[name][name=~/^(?i)(mosque|cami|masjid|مسجد)$/][amenity=place_of_worship][religion=muslim],
89*[name][name=~/^(?i)(parking|parkplatz)$/][amenity=parking],
90*[name][name=~/^(?i)(post office)$/][amenity=post_office],
91*[name][name=~/^(?i)(restaurant)$/][amenity=restaurant],
92*[name][name=~/^(?i)(toilets?)$/][amenity=toilets],
93*[name][name=~/^(?i)(playground|spielplatz)$/][leisure=playground],
94*[name][name=~/^(?i)(shop|boutique)$/][shop][shop!=no],
95*[name][name=~/^(?i)(building|bangunan)$/][building][building!=no],
96*[name][name=~/^(?i)(house|maison|rumah|vivienda)$/][building=house],
97*[name][name=~/^(?i)(casa)$/][building=house][outside("FR")], /* spanish for house but it is a brand name in France */
98*[name][name=~/^(?i)(kiosk)$/][shop=kiosk][outside("NL")], /* it is a brand name in the Netherlands */
99*[name][name=~/^(?i)(path)$/][highway=path],
100*[name][name=~/^(?i)(jalan)$/][highway],
101*[name][name=~/^(?i)(silo)$/][man_made=silo],
102*[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][amenity=grave_yard],
103*[name][name=~/^(?i)(cemetery|cementerio|cimetière|cmentarz|friedhof)$/][landuse=cemetery],
104*[name][name=~/^(?i)(monument aux morts|war memorial)$/][historic=memorial][memorial=war_memorial],
105*[name][name=~/^(?i)(school|école|Школа)$/][amenity=school],
106*[name][name=~/^(?i)(école élémentaire)$/][amenity=school]["school:FR"="élémentaire"],
107*[name][name=~/^(?i)(école maternelle)$/][amenity=school]["school:FR"="maternelle"],
108*[name][name=~/^(?i)(école primaire)$/][amenity=school]["school:FR"="primaire"],
109*[name][name=~/^(?i)(collège)$/][amenity=school]["school:FR"="collège"],
110*[name][name=~/^(?i)(lycée)$/][amenity=school]["school:FR"="lycée"],
111*[name][name=~/^(?i)(Аптека|farmacia|pharmacy|pharmacie)$/][amenity=pharmacy],
112*[name][name=~/^(?i)(hydrant)$/][emergency=fire_hydrant],
113*[name][name=~/^(?i)(АГЗС|АЗС)$/][amenity=fuel] {
114 throwWarning: tr("{0}", "{0.tag}");
115 group: tr("descriptive name");
116 fixRemove: "name";
117 assertMatch: "node name=parking amenity=parking";
118 assertMatch: "node name=Parking amenity=parking";
119 assertNoMatch: "node name=Parking_with_suffix amenity=parking";
120 assertNoMatch: "node name=Megaparking amenity=parking";
121 assertMatch: "relation name=parking amenity=parking type=multipolygon";
122 assertMatch: "relation name=Parking amenity=parking type=multipolygon";
123 assertNoMatch: "way name=parking";
124 assertMatch: "relation name=PLAYGROUND leisure=playground type=multipolygon";
125 assertMatch: "node name=PLaYGrOUNd leisure=playground";
126 assertMatch: "node name=shop shop=whatever";
127 assertNoMatch: "node name=shop shop=no";
128 assertNoMatch: "way name=shop leisure=playground";
129 assertMatch: "way name=building building=yes";
130 assertMatch: "way name=building building=house";
131 assertMatch: "way name=Rumah building=house";
132 assertNoMatch: "way name=Rumah building=yes";
133 assertMatch: "way name=house building=house";
134 assertNoMatch: "way name=house building=yes";
135 assertMatch: "way name=kiosk building=yes shop=kiosk";
136 assertNoMatch: "way name=kiosk building=yes";
137 assertMatch: "way name=silo man_made=silo";
138 assertMatch: "way name=Silo man_made=silo building=silo";
139 assertNoMatch: "way name=Silo building=silo";
140 assertMatch: "way name=cemetery amenity=grave_yard";
141 assertMatch: "way name=Cmentarz amenity=grave_yard";
142 assertNoMatch: "way name=kiosk amenity=grave_yard";
143}
144 /* the following without fixRemove to avoid information loss, should be checked manually */
145*[name][name=~/^(?i)(chapel|chapelle|kapelle)$/][tag("building")=="chapel"||tag("amenity")=="place_of_worship"], /* check if amenity=place_of_worship and/or building=chapel applies */
146*[name][name=~/^(?i)(silo)$/][man_made!=silo], /* check if man_made=silo and/or building=silo applies */
147*[name][name=~/^(?i)(school|école|Школа)$/][amenity!=school], /* check if amenity=school and/or building=school applies applies */
148*[name][name=~/^(?i)(house|rumah|vivienda)$/][building][building!=house][building!=no], /* check if building=house applies */
149*[name][name=~/^(?i)(casa)$/][building][building!=house][building!=no][outside("FR")] { /* check if building=house applies */
150 throwWarning: tr("{0}", "{0.tag}");
151 group: tr("descriptive name");
152 assertMatch: "way name=Silo building=silo";
153 assertNoMatch: "way name=building building=yes";
154 assertNoMatch: "way name=building building=house";
155 assertNoMatch: "way name=Rumah building=house";
156 assertMatch: "way name=Rumah building=yes";
157 assertNoMatch: "way name=house building=house";
158 assertMatch: "way name=house building=yes";
159}
160
161/* #2760 */
162*[/^gpx:/],
163*[/^gpxx:/],
164*[/^gpxd:/] {
165 throwWarning: tr("{0} should not be uploaded", "{0.key}");
166 group: tr("unnecessary tag");
167 fixRemove: "{0.key}";
168 assertMatch: "node gpx:time=2018-01-01T12:00:00Z";
169 assertMatch: "node gpxd:color=#FF0000";
170 assertNoMatch: "node source=gpx:foo";
171}
Note: See TracBrowser for help on using the repository browser.