source: josm/trunk/data/validator/geometry.mapcss @ 7975

Last change on this file since 7975 was 7975, checked in by Klumbumbus, 5 years ago

see #10835 - icon unification and geometry consistency for some water related tags. add validator warnings

  • Property svn:eol-style set to native
File size: 6.0 KB
Line 
1/* {0} on a node, should be a way */
2node[oneway],
3node[bridge],
4node[sidewalk],
5node[footway],
6node[man_made=embankment],
7node[man_made=groyne],
8node[aerialway=cable_car],
9node[aerialway=gondola],
10node[aerialway=chair_lift],
11node[aerialway=mixed_lift],
12node[aerialway=drag_lift],
13node[aerialway=t-bar],
14node[aerialway=j-bar],
15node[aerialway=platter],
16node[aerialway=magic_carpet],
17node[aerialway=rope_tow],
18node[aerialway=goods],
19node[waterway=river],
20node[waterway=canal],
21node[waterway=wadi],
22node[waterway=stream],
23node[waterway=ditch],
24node[waterway=drain],
25node[natural=coastline],
26node[natural=ridge],
27node[natural=tree_row] {
28  throwWarning: tr("{0} on a node. Should be used on a way.", "{0.tag}");
29  assertMatch: "node oneway=-1";
30  assertNoMatch: "way oneway=-1";
31  assertMatch: "node bridge=yes";
32  assertMatch: "node bridge=viaduct";
33}
34
35/* {0} on a node, should be an area; see ticket #10679 */
36node[landuse],
37node[natural=scree],
38node[natural=scrub],
39node[natural=fell],
40node[natural=heath],
41node[natural=wood],
42node[natural=grassland],
43node[natural=wetland],
44node[natural=water],
45node[natural=mud],
46node[natural=beach],
47node[natural=sand],
48node[natural=wood],
49node[natural=bare_rock],
50node[waterway=riverbank],
51node[man_made=bridge],
52node[man_made=breakwater],
53node[power=plant],
54node[source:outline] {
55  throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
56}
57
58/* {0} on a node, should be a relation; see #10252, #10769 */
59node[route],
60node[restriction] {
61  throwWarning: tr("{0}=* on a node. Should be used in a relation", "{0.key}"); 
62}
63
64/* {0} on a way, should be a node */
65way[entrance],
66way[man_made=survey_point],
67way[power=pole],
68way[natural=peak],
69way[natural=saddle],
70way[natural=volcano],
71way[natural=tree] {
72  throwWarning: tr("{0} on a way. Should be used on a node.", "{0.tag}"); 
73}
74
75/* {0} on a way, should be a relation; see #10252 */
76way[route=bus] {
77  throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}"); 
78}
79
80/* see ticket:#10125 */
81node[source:geometry] {
82  throwWarning: tr("{0} on a node", "{0.key}");
83  fixChangeKey: "source:geometry => source:position";
84}
85
86/* Building inside building (spatial test) */
87*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")] 
88*[building][building!~/no|entrance/] {
89  throwWarning: tr("Building inside building");
90}
91
92/* Overlapping areas (spatial test) */
93area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
94  set water_area;
95}
96
97/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
98area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/]  area:closed:areaStyle.water_area,
99area:closed:areaStyle[landuse=reservoir]                         area:closed:areaStyle.water_area {
100  throwWarning: tr("Overlapping Water Areas");
101}
102
103area:closed:areaStyle  area:closed:areaStyle {
104  throwOther: tr("Overlapping Areas");
105}
106
107/* see ticket #9311 */
108node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/]  *[amenity=parking] {
109  throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
110}
111
112/* see ticket #9556 */
113area:closed:areaStyle[tag("natural") = parent_tag("natural")]  area:closed:areaStyle[natural] {
114  throwWarning: tr("Overlapping Identical Natural Areas");
115}
116
117area:closed:areaStyle[tag("landuse") = parent_tag("landuse")]  area:closed:areaStyle[landuse] {
118  throwWarning: tr("Overlapping Identical Landuses");
119}
120
121/* see ticket:#9522 */
122node[tag("amenity") = parent_tag("amenity")]  *[amenity][amenity != parking] {
123  throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
124}
125node[tag("leisure") = parent_tag("leisure")]  *[leisure] {
126  throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
127}
128node[tag("tourism") = parent_tag("tourism")]  *[tourism] {
129  throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
130}
131node[tag("shop") = parent_tag("shop")]  *[shop] {
132  throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
133}
134node[tag("power") = parent_tag("power")]  *[power] {
135  throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
136}
137
138/* isolated nodes which should be part of a way, see #10825 */
139node:unconnected[entrance],
140node:unconnected[traffic_calming],
141node:unconnected[highway=passing_place],
142node:unconnected[highway=mini_roundabout],
143node:unconnected[highway=motorway_junction],
144node:unconnected[highway=turning_loop],
145node:unconnected[highway=turning_circle],
146node:unconnected[highway=stop],
147node:unconnected[highway=give_way],
148node:unconnected[highway=traffic_signals],
149node:unconnected[highway=crossing],
150node:unconnected[crossing],
151node:unconnected[railway=crossing],
152node:unconnected[railway=level_crossing],
153node:unconnected[railway=buffer_stop],
154node:unconnected[public_transport=stop_position],
155node:unconnected[noexit],
156node:unconnected[waterway=dam],
157node:unconnected[waterway=weir],
158node:unconnected[waterway=waterfall],
159node:unconnected[amenity=ferry_terminal],
160node:unconnected[mountain_pass=yes],
161node:unconnected[barrier=gate],
162node:unconnected[barrier=lift_gate],
163node:unconnected[barrier=swing_gate],
164node:unconnected[barrier=toll_booth],
165node:unconnected[barrier=turnstile],
166node:unconnected[barrier=full-height_turnstile],
167node:unconnected[barrier=motorcycle_barrier],
168node:unconnected[barrier=rope],
169node:unconnected[barrier=sally_port],
170node:unconnected[barrier=spikes],
171node:unconnected[barrier=stile],
172node:unconnected[barrier=sump_buster],
173node:unconnected[barrier=kerb],
174node:unconnected[barrier=border_control],
175node:unconnected[barrier=bump_gate],
176node:unconnected[barrier=bus_trap],
177node:unconnected[barrier=cattle_grid],
178node:unconnected[barrier=chain],
179node:unconnected[barrier=cycle_barrier],
180node:unconnected[barrier=hampshire_gate],
181node:unconnected[barrier=height_restrictor],
182node:unconnected[barrier=debris] {
183  throwWarning: tr("{0} must be connected to a way", "{1.tag}");
184}
Note: See TracBrowser for help on using the repository browser.