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

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

see #15203 - warn about some highway tags used on ways instead of nodes

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