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

Last change on this file since 10518 was 10429, checked in by Klumbumbus, 8 years ago

see #11006 - rework of public transport mappaint style and presets, mainly icon improvements, prioritise ptv2 over legacy, drop transport types for platform

  • Property svn:eol-style set to native
File size: 9.8 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[railway=subway_entrance],
84way[man_made=survey_point],
85way[power=transformer],
86way[power=pole],
87way[power=tower]!:closed,
88way[amenity=vending_machine],
89way[natural=peak],
90way[natural=saddle],
91way[natural=volcano],
92way[natural=tree] {
93 throwWarning: tr("{0} on a way. Should be used on a node.", "{0.tag}");
94}
95
96/* {0} on a way, should be a relation; see #10252 */
97way[route=bus] {
98 throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}");
99}
100
101/* #12502 */
102node[leisure=park][natural=tree] {
103 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
104 fixRemove: "leisure";
105}
106node[leisure=park][natural!=tree] {
107 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
108}
109
110/* see ticket:#10125 */
111node[source:geometry] {
112 throwWarning: tr("{0} on a node", "{0.key}");
113 fixChangeKey: "source:geometry => source:position";
114}
115
116/* Building inside building (spatial test) */
117*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")]
118*[building][building!~/no|entrance/] {
119 throwWarning: tr("Building inside building");
120}
121
122/* Overlapping areas (spatial test) */
123area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
124 set water_area;
125}
126
127/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
128area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/] area:closed:areaStyle.water_area,
129area:closed:areaStyle[landuse=reservoir] area:closed:areaStyle.water_area {
130 throwWarning: tr("Overlapping Water Areas");
131}
132
133area:closed:areaStyle area:closed:areaStyle {
134 throwOther: tr("Overlapping Areas");
135}
136
137/* see ticket #9311 */
138node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] *[amenity=parking] {
139 throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
140}
141
142/* see ticket #9556 */
143area:closed:areaStyle[tag("natural") = parent_tag("natural")] area:closed:areaStyle[natural] {
144 throwWarning: tr("Overlapping Identical Natural Areas");
145}
146
147area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] area:closed:areaStyle[landuse] {
148 throwWarning: tr("Overlapping Identical Landuses");
149}
150
151/* see ticket:#9522 */
152node[tag("amenity") = parent_tag("amenity")] *[amenity][amenity != parking] {
153 throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
154}
155node[tag("leisure") = parent_tag("leisure")] *[leisure] {
156 throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
157}
158node[tag("tourism") = parent_tag("tourism")] *[tourism] {
159 throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
160}
161node[tag("shop") = parent_tag("shop")] *[shop] {
162 throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
163}
164node[tag("power") = parent_tag("power")] *[power] {
165 throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
166}
167
168/* isolated nodes which should be part of a way, see #10825 */
169node:unconnected:in-downloaded-area[entrance],
170node:unconnected:in-downloaded-area[traffic_calming],
171node:unconnected:in-downloaded-area[highway=passing_place],
172node:unconnected:in-downloaded-area[highway=mini_roundabout],
173node:unconnected:in-downloaded-area[highway=motorway_junction],
174node:unconnected:in-downloaded-area[highway=turning_loop],
175node:unconnected:in-downloaded-area[highway=turning_circle],
176node:unconnected:in-downloaded-area[highway=stop],
177node:unconnected:in-downloaded-area[highway=give_way],
178node:unconnected:in-downloaded-area[highway=traffic_signals],
179node:unconnected:in-downloaded-area[highway=crossing],
180node:unconnected:in-downloaded-area[crossing],
181node:unconnected:in-downloaded-area[railway=crossing],
182node:unconnected:in-downloaded-area[railway=level_crossing],
183node:unconnected:in-downloaded-area[railway=buffer_stop],
184node:unconnected:in-downloaded-area[public_transport=stop_position],
185node:unconnected:in-downloaded-area[noexit],
186node:unconnected:in-downloaded-area[waterway=dam],
187node:unconnected:in-downloaded-area[waterway=weir],
188node:unconnected:in-downloaded-area[waterway=waterfall],
189node:unconnected:in-downloaded-area[amenity=ferry_terminal],
190node:unconnected:in-downloaded-area[mountain_pass=yes],
191node:unconnected:in-downloaded-area[barrier=gate],
192node:unconnected:in-downloaded-area[barrier=lift_gate],
193node:unconnected:in-downloaded-area[barrier=swing_gate],
194node:unconnected:in-downloaded-area[barrier=toll_booth],
195node:unconnected:in-downloaded-area[barrier=turnstile],
196node:unconnected:in-downloaded-area[barrier=full-height_turnstile],
197node:unconnected:in-downloaded-area[barrier=motorcycle_barrier],
198node:unconnected:in-downloaded-area[barrier=rope],
199node:unconnected:in-downloaded-area[barrier=sally_port],
200node:unconnected:in-downloaded-area[barrier=spikes],
201node:unconnected:in-downloaded-area[barrier=stile],
202node:unconnected:in-downloaded-area[barrier=sump_buster],
203node:unconnected:in-downloaded-area[barrier=kerb],
204node:unconnected:in-downloaded-area[barrier=border_control],
205node:unconnected:in-downloaded-area[barrier=bump_gate],
206node:unconnected:in-downloaded-area[barrier=bus_trap],
207node:unconnected:in-downloaded-area[barrier=cattle_grid],
208node:unconnected:in-downloaded-area[barrier=chain],
209node:unconnected:in-downloaded-area[barrier=cycle_barrier],
210node:unconnected:in-downloaded-area[barrier=hampshire_gate],
211node:unconnected:in-downloaded-area[barrier=height_restrictor],
212node:unconnected:in-downloaded-area[barrier=debris] {
213 throwWarning: tr("{0} must be connected to a way", "{2.tag}");
214}
215
216/*see #11127*/
217way[railway][bridge] > node,
218way[highway][bridge] > node {
219 set node_in_bridge;
220}
221way[waterway] > node.node_in_bridge {
222 throwWarning: tr("node connects waterway and bridge");
223}
224
225/*see #11128*/
226way[highway] > node[tourism=information][information=guidepost] {
227 set guidepost;
228 throwOther: tr("{0} node connected to a highway", "{1.tag}");
229}
230way[highway] > node[amenity][!entrance][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking|bus_station|car_wash|ferry_terminal)$/],
231way[highway] > node[building][!entrance],
232way[highway] > node[leisure][!entrance][leisure!=slipway],
233way[highway] > node[office][!entrance],
234way[highway] > node[shop][!entrance],
235way[highway] > node[tourism][!entrance][tourism!=viewpoint]!.guidepost {
236 throwWarning: tr("{0} node connected to a highway", "{0.key}");
237}
238
239way[junction=roundabout]:righthandtraffic:clockwise,
240way[junction=roundabout]!:righthandtraffic:anticlockwise {
241 throwWarning: tr("suspicious roundabout direction");
242}
243
244/* #12496 */
245area:closed[place=islet][eval(areasize()) > 1500000] {
246 throwWarning: tr("{0} on a large area", "{1.tag}");
247 suggestAlternative: "place=island";
248 fixAdd: "place=island";
249}
250
251area:closed[place=island][eval(areasize()) < 500000] {
252 throwWarning: tr("{0} on a small area", "{1.tag}");
253 suggestAlternative: "place=islet";
254 fixAdd: "place=islet";
255}
256
257/* 12561 - building larger than Aalsmeer Flower Auction */
258area:closed[building][eval(areasize()) > 500000] {
259 throwWarning: tr("Too large building");
260}
261
262/* #12577 */
263way[power=line] > node,
264way[power=minor_line] > node,
265way[power=cable] > node {
266 set node_in_power_way;
267}
268way[!power][!building] > node.node_in_power_way {
269 throwWarning: tr("Node connects a power line or cable with an object which is not related to the power infrastructure.");
270}
271
272/* #12646, #12992 */
273way[waterway=~/^(stream|ditch|river|drain)$/]!:closed >[index=-1] node!:connection:in-downloaded-area {
274 throwWarning: tr("Waterway ends without a connection to another waterway or the direction of the waterway is wrong.");
275}
276
277/* #10717 */
278way[natural=coastline] area[natural=water],
279way[natural=coastline] area[waterway=riverbank] {
280 throwError: tr("Coastline inside {1}", "{0.tag}");
281}
Note: See TracBrowser for help on using the repository browser.