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

Last change on this file since 9494 was 9494, checked in by Klumbumbus, 7 years ago

see #12386 - allow power=insulator on ways in preset; add validator warnings for power=tower on unclosed way and power=line on node

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