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

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

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