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

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

see #10837 - add building:part=yes, building:levels, height, building:min_level and min_height

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