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

Last change on this file since 8695 was 8589, checked in by Don-vip, 9 years ago

fix #11677 - "null must be connected to a way" validator warning (regression from r8522)

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