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

Last change on this file since 13078 was 13074, checked in by Klumbumbus, 8 years ago

fix #15478 - Warn about unconnected highway=milestone and railway=milestone (patch by naoliv)

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