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

Last change on this file since 14123 was 14123, checked in by Klumbumbus, 10 months ago

fix #15769, see #12297, see #12386 - Add power=catenary_mast and power=terminal

  • Property svn:eol-style set to native
File size: 13.8 KB
Line 
1/* {0} on a node, should be a way */
2node[area=no],
3node[oneway],
4node[bridge],
5node[sidewalk],
6node[footway],
7node[man_made=embankment],
8node[man_made=groyne],
9node[man_made=cutline],
10node[power=line],
11node[cutline],
12node[aerialway=cable_car],
13node[aerialway=gondola],
14node[aerialway=chair_lift],
15node[aerialway=mixed_lift],
16node[aerialway=drag_lift],
17node[aerialway=t-bar],
18node[aerialway=j-bar],
19node[aerialway=platter],
20node[aerialway=magic_carpet],
21node[aerialway=rope_tow],
22node[aerialway=goods],
23node[aeroway=taxiway],
24node[aeroway=runway],
25node[railway=rail],
26node[railway=narrow_gauge],
27node[railway=monorail],
28node[railway=preserved],
29node[railway=light_rail],
30node[railway=subway],
31node[railway=tram],
32node[railway=disused],
33node[railway=abandoned],
34node[waterway=river],
35node[waterway=canal],
36node[waterway=stream],
37node[waterway=ditch],
38node[waterway=drain],
39node[natural=coastline],
40node[natural=ridge],
41node[natural=valley],
42node[natural=tree_row] {
43  throwWarning: tr("{0} on a node. Should be used on a way.", "{0.tag}");
44  assertMatch: "node oneway=-1";
45  assertNoMatch: "way oneway=-1";
46  assertMatch: "node bridge=yes";
47  assertMatch: "node bridge=viaduct";
48}
49
50/* {0} on a node, should be a way or relation */
51node[boundary=administrative] {
52  throwWarning: tr("{0} on a node. Should be used on a way or relation.", "{0.tag}");
53}
54
55/* {0} on a node, should be an area; #10679 #16528 */
56node[golf=green],
57node[golf=bunker],
58node[golf=fairway],
59node[area=yes],
60node[landuse],
61node[natural=scree],
62node[natural=scrub],
63node[natural=fell],
64node[natural=heath],
65node[natural=wood],
66node[natural=grassland],
67node[natural=wetland],
68node[natural=water],
69node[natural=mud],
70node[natural=beach],
71node[natural=sand],
72node[natural=wood],
73node[natural=bare_rock],
74node[natural=glacier],
75node[waterway=riverbank],
76node[man_made=bridge],
77node[man_made=breakwater],
78node[aeroway=apron],
79node[power=plant],
80node[building:part],
81node[source:outline] {
82  throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
83}
84
85/* {0} on a node, should be a relation; Error level; see #10252, #10769, #14288 */
86node[type=multipolygon],
87node[route],
88node[restriction] {
89  throwError: tr("{0} on a node. Should be used in a relation", "{0.tag}"); 
90}
91
92/* {0} on a way, should be a node */
93way[entrance],
94way[railway=subway_entrance],
95way[man_made=survey_point],
96way[aeroway=holding_position],
97way[power=transformer],
98way[power=pole],
99way[power=catenary_mast],
100way[power=terminal],
101way[power=tower]!:closed,
102way[amenity=vending_machine],
103way[natural=peak],
104way[natural=saddle],
105way[natural=volcano],
106way[natural=tree],
107way[highway=give_way],
108way[highway=milestone],
109way[highway=mini_roundabout],
110way[highway=stop],
111way[highway=street_lamp],
112way[highway=traffic_signals],
113way[highway=turning_loop],
114way[highway=turning_circle],
115way[highway=motorway_junction] {
116  throwWarning: tr("{0} on a way. Should be used on a node.", "{0.tag}"); 
117}
118
119/* {0} on a way, should be a relation; see #15642, #10252, #14288 */
120way[restriction][restriction =~ /^(no_right_turn|no_left_turn|no_u_turn|no_straight_on|only_right_turn|only_left_turn|only_straight_on|no_entry|no_exit)$/],
121way[type=multipolygon],
122way[route=bus] {
123  throwError: tr("{0} on a way. Should be used in a relation", "{0.tag}"); 
124}
125
126/* #14395 */
127way >[index=1] node,
128way >[index=-1] node {
129  set first_last_node;
130}
131way[highway][area!=yes][!tunnel][!covered] > node {
132  set node_in_highway;
133}
134way[building][building!=no] > node.node_in_highway!.first_last_node {
135  throwWarning: tr("node connects highway and building");
136}
137
138/* #15035, must not warn for node 3815077900*/
139node[man_made!=monitoring_station][at(0.0,0.0)] {
140  throwError: tr("Object at Position 0.00E 0.00N. There is nothing at this position except an already mapped weather buoy.");
141  fixDeleteObject: this;
142}
143
144/* #12502 */
145node[leisure=park][natural=tree] {
146  throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
147  group: tr("suspicious tag combination");
148  fixRemove: "leisure";
149}
150node[leisure=park][natural!=tree] {
151  throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
152}
153
154/* see ticket:#10125 */
155node[source:geometry] {
156  throwWarning: tr("{0} on a node", "{0.key}");
157  fixChangeKey: "source:geometry => source:position";
158}
159
160/* Building inside building (spatial test) */
161*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")] 
162*[building][building!~/no|entrance/] {
163  throwWarning: tr("Building inside building");
164}
165
166/* Overlapping areas (spatial test) */
167area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
168  set water_area;
169}
170
171/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
172area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/]  area:closed:areaStyle.water_area,
173area:closed:areaStyle[landuse=reservoir]                         area:closed:areaStyle.water_area {
174  throwWarning: tr("Overlapping Water Areas");
175}
176
177area:closed:areaStyle  area:closed:areaStyle {
178  throwOther: tr("Overlapping Areas");
179}
180
181/* see ticket #9311 */
182node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/]  *[amenity=parking] {
183  throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
184  group: tr("{0} inside {1}", "amenity", "amenity");
185}
186
187/* see ticket #9556 */
188area:closed:areaStyle[tag("natural") = parent_tag("natural")]  area:closed:areaStyle[natural] {
189  throwWarning: tr("Overlapping Identical Natural Areas");
190}
191
192area:closed:areaStyle[landuse!=residential][tag("landuse") = parent_tag("landuse")]  area:closed:areaStyle[landuse][landuse!=residential] {
193  throwWarning: tr("Overlapping Identical Landuses");
194}
195
196/* see ticket:#9522 */
197node[tag("amenity") = parent_tag("amenity")]  *[amenity][amenity != parking] {
198  throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
199  group: tr("{0} inside {1}", "amenity", "amenity");
200}
201node[tag("leisure") = parent_tag("leisure")]  *[leisure] {
202  throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
203  group: tr("{0} inside {1}", "leisure", "leisure");
204}
205node[tag("tourism") = parent_tag("tourism")]  *[tourism] {
206  throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
207  group: tr("{0} inside {1}", "tourism", "tourism");
208}
209node[tag("shop") = parent_tag("shop")]  *[shop] {
210  throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
211  group: tr("{0} inside {1}", "shop", "shop");
212}
213node[tag("power") = parent_tag("power")]  *[power] {
214  throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
215  group: tr("{0} inside {1}", "power", "power");
216}
217
218/* isolated nodes which should be part of a way, see #10825, #15478 */
219node:unconnected:in-downloaded-area[entrance],
220node:unconnected:in-downloaded-area[traffic_calming],
221node:unconnected:in-downloaded-area[highway=passing_place],
222node:unconnected:in-downloaded-area[highway=mini_roundabout],
223node:unconnected:in-downloaded-area[highway=motorway_junction],
224node:unconnected:in-downloaded-area[highway=turning_loop],
225node:unconnected:in-downloaded-area[highway=turning_circle],
226node:unconnected:in-downloaded-area[highway=stop],
227node:unconnected:in-downloaded-area[highway=give_way],
228node:unconnected:in-downloaded-area[highway=traffic_signals],
229node:unconnected:in-downloaded-area[highway=crossing],
230node:unconnected:in-downloaded-area[crossing],
231node:unconnected:in-downloaded-area[highway=milestone],
232node:unconnected:in-downloaded-area[railway=milestone],
233node:unconnected:in-downloaded-area[railway=crossing],
234node:unconnected:in-downloaded-area[railway=level_crossing],
235node:unconnected:in-downloaded-area[railway=buffer_stop],
236node:unconnected:in-downloaded-area[public_transport=stop_position],
237node:unconnected:in-downloaded-area[aeroway=holding_position],
238node:unconnected:in-downloaded-area[noexit],
239node:unconnected:in-downloaded-area[waterway=dam],
240node:unconnected:in-downloaded-area[waterway=weir],
241node:unconnected:in-downloaded-area[waterway=waterfall],
242node:unconnected:in-downloaded-area[amenity=ferry_terminal],
243node:unconnected:in-downloaded-area[leisure=slipway],
244node:unconnected:in-downloaded-area[mountain_pass=yes],
245node:unconnected:in-downloaded-area[barrier=gate],
246node:unconnected:in-downloaded-area[barrier=lift_gate],
247node:unconnected:in-downloaded-area[barrier=swing_gate],
248node:unconnected:in-downloaded-area[barrier=toll_booth],
249node:unconnected:in-downloaded-area[barrier=turnstile],
250node:unconnected:in-downloaded-area[barrier=full-height_turnstile],
251node:unconnected:in-downloaded-area[barrier=motorcycle_barrier],
252node:unconnected:in-downloaded-area[barrier=rope],
253node:unconnected:in-downloaded-area[barrier=sally_port],
254node:unconnected:in-downloaded-area[barrier=spikes],
255node:unconnected:in-downloaded-area[barrier=stile],
256node:unconnected:in-downloaded-area[barrier=sump_buster],
257node:unconnected:in-downloaded-area[barrier=kerb],
258node:unconnected:in-downloaded-area[barrier=border_control],
259node:unconnected:in-downloaded-area[barrier=bump_gate],
260node:unconnected:in-downloaded-area[barrier=bus_trap],
261node:unconnected:in-downloaded-area[barrier=cattle_grid],
262node:unconnected:in-downloaded-area[barrier=chain],
263node:unconnected:in-downloaded-area[barrier=cycle_barrier],
264node:unconnected:in-downloaded-area[barrier=hampshire_gate],
265node:unconnected:in-downloaded-area[barrier=height_restrictor],
266node:unconnected:in-downloaded-area[barrier=debris] {
267  throwWarning: tr("{0}", "{2.tag}");
268  group: tr("isolated node which must be connected to a way");
269}
270
271/* #11127 */
272way[railway][bridge] > node,
273way[highway][bridge] > node {
274  set node_in_bridge;
275}
276way[waterway] > node.node_in_bridge {
277  throwWarning: tr("node connects waterway and bridge");
278}
279
280/* #11128, #14812, #15032 */
281way[highway] > node[tourism=information][information=guidepost] {
282  set guidepost;
283  throwOther: tr("{0} node connected to a highway", "{1.tag}");
284}
285way[highway] > node[amenity][!entrance][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking|bus_station|car_wash|ferry_terminal|weighbridge)$/],
286way[highway] > node[building][!entrance],
287way[highway] > node[leisure][!entrance][leisure!=slipway],
288way[highway] > node[office][!entrance],
289way[highway] > node[shop][!entrance],
290way[highway] > node[tourism][!entrance][tourism!=viewpoint]!.guidepost.first_last_node:connection,
291way[highway] > node[tourism][!entrance][tourism!=viewpoint]!.guidepost!.first_last_node {
292  throwWarning: tr("{0} node connected to a highway", "{0.key}");
293}
294
295way[junction=roundabout]:righthandtraffic:clockwise,
296way[junction=roundabout]!:righthandtraffic:anticlockwise {
297  throwWarning: tr("suspicious roundabout direction");
298}
299
300/* #12496 */
301area:closed[place=islet][eval(areasize()) > 1500000] {
302  throwWarning: tr("{0} on a large area", "{1.tag}");
303  suggestAlternative: "place=island";
304  fixAdd: "place=island";
305}
306
307area:closed[place=island][eval(areasize()) < 500000] {
308  throwWarning: tr("{0} on a small area", "{1.tag}");
309  suggestAlternative: "place=islet";
310  fixAdd: "place=islet";
311}
312
313/* #15648 */
314way[place=island]!:closed {
315  throwError: tr("Way with {1} not closed.", "{0.tag}");
316}
317
318/* #12561 - building larger than Aalsmeer Flower Auction (518000) and Tesla factory (510000) */
319area:closed[building][building!=no][eval(areasize()) > 520000] {
320  throwError: tr("Too large building");
321}
322
323/* #12577 */
324way[power=line] > node,
325way[power=minor_line] > node,
326way[power=cable] > node {
327  set node_in_power_way;
328}
329way[!power][!building] > node.node_in_power_way {
330  throwWarning: tr("Node connects a power line or cable with an object which is not related to the power infrastructure.");
331}
332
333/* #12646, #12992 */
334way[waterway=~/^(stream|ditch|river|drain)$/]!:closed >[index=-1] node[natural!=sinkhole][natural!=cave_entrance]!:connection:in-downloaded-area { 
335  throwWarning: tr("Waterway ends without a connection to another waterway or the direction of the waterway is wrong.");
336}
337
338/* #10717, #14535 */
339way:closed[natural=coastline]  area[natural=water],
340way:closed[natural=coastline]  area[waterway=riverbank] {
341  throwError: tr("Coastline inside {1}", "{0.tag}");
342}
343
344/* #10471 */
345way[waterway] > node[ford?] { set ford_on_waterway; }
346way[highway] > node[ford?] { set ford_on_highway; }
347node[ford?]:in-downloaded-area!.ford_on_waterway, node[ford?]:in-downloaded-area!.ford_on_highway {
348    throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
349}
350
351/* #13877 */
352area:closed[waterway = canal][area!=no],
353area:closed[waterway = drain][area!=no],
354area:closed[waterway = ditch][area!=no],
355area:closed[waterway = stream][area!=no],
356area:closed[waterway = river][area!=no] {
357  throwWarning: tr("{0} is the tag for the linear waterway. To tag the water area use {1} + {2} instead.", "{1.tag}", "natural=water", "water=*");
358}
359
360/* #15097 */
361way[highway][area!=yes] > node,
362way[man_made=pier] > node {
363  set node_in_highway_pier;
364}
365way[route=ferry][tunnel=yes] > node,
366way[route=ferry][bridge=yes] > node {
367  set node_in_ferry_bridge_tunnel;
368}
369way[route=ferry]!:closed >[index= 1] node!.node_in_highway_pier!.node_in_ferry_bridge_tunnel:in-downloaded-area,
370way[route=ferry]!:closed >[index=-1] node!.node_in_highway_pier!.node_in_ferry_bridge_tunnel:in-downloaded-area { 
371  throwWarning: tr("Ferry route is not connected to the road network or branches.");
372}
373way[amenity=ferry_terminal] > node,
374way[man_made=pier] > node {
375  set node_in_terminal_pier;
376}
377way[route=ferry]!:closed >[index= 1] node[amenity!=ferry_terminal][man_made!=pier]!.node_in_terminal_pier!.node_in_ferry_bridge_tunnel:in-downloaded-area,
378way[route=ferry]!:closed >[index=-1] node[amenity!=ferry_terminal][man_made!=pier]!.node_in_terminal_pier!.node_in_ferry_bridge_tunnel:in-downloaded-area { 
379  throwWarning: tr("Ferry route is not connected to a ferry terminal or branches.");
380}
Note: See TracBrowser for help on using the repository browser.