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

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

fix #12496 - Verify properly tagged islands and islets (modified patch by naoliv)

  • Property svn:eol-style set to native
File size: 8.3 KB
RevLine 
[7735]1/* {0} on a node, should be a way */
[6550]2node[oneway],
[7960]3node[bridge],
[7707]4node[sidewalk],
[7814]5node[footway],
[7960]6node[man_made=embankment],
[7975]7node[man_made=groyne],
[8147]8node[man_made=cutline],
[9494]9node[power=line],
[8147]10node[cutline],
[7915]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],
[7977]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],
[7737]33node[waterway=river],
34node[waterway=canal],
35node[waterway=stream],
36node[waterway=ditch],
[7975]37node[waterway=drain],
[7735]38node[natural=coastline],
39node[natural=ridge],
[8135]40node[natural=valley],
[7735]41node[natural=tree_row] {
[7942]42 throwWarning: tr("{0} on a node. Should be used on a way.", "{0.tag}");
[6550]43 assertMatch: "node oneway=-1";
44 assertNoMatch: "way oneway=-1";
45 assertMatch: "node bridge=yes";
[7963]46 assertMatch: "node bridge=viaduct";
[6611]47}
48
[7735]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],
[9022]64node[natural=glacier],
[7735]65node[waterway=riverbank],
[7960]66node[man_made=bridge],
[7975]67node[man_made=breakwater],
[7977]68node[aeroway=apron],
[7967]69node[power=plant],
[8139]70node[building:part],
[7735]71node[source:outline] {
72 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
[7468]73}
74
[7744]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
[7942]81/* {0} on a way, should be a node */
[7960]82way[entrance],
83way[man_made=survey_point],
[9500]84way[power=transformer],
[7967]85way[power=pole],
[9494]86way[power=tower]!:closed,
[7977]87way[amenity=vending_machine],
[7942]88way[natural=peak],
89way[natural=saddle],
90way[natural=volcano],
91way[natural=tree] {
92 throwWarning: tr("{0} on a way. Should be used on a node.", "{0.tag}");
93}
94
[7744]95/* {0} on a way, should be a relation; see #10252 */
96way[route=bus] {
97 throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}");
98}
99
[9745]100/* #12502 */
101node[leisure=park][natural=tree] {
102 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
103 fixRemove: "leisure";
104}
105node[leisure=park][natural!=tree] {
106 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
107}
108
[7279]109/* see ticket:#10125 */
110node[source:geometry] {
111 throwWarning: tr("{0} on a node", "{0.key}");
112 fixChangeKey: "source:geometry => source:position";
113}
114
[6611]115/* Building inside building (spatial test) */
[7164]116*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")]
[6861]117*[building][building!~/no|entrance/] {
[6611]118 throwWarning: tr("Building inside building");
[6613]119}
120
121/* Overlapping areas (spatial test) */
122area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
123 set water_area;
124}
125
[7280]126/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
127area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/] area:closed:areaStyle.water_area,
128area:closed:areaStyle[landuse=reservoir] area:closed:areaStyle.water_area {
[6613]129 throwWarning: tr("Overlapping Water Areas");
130}
131
[6630]132area:closed:areaStyle area:closed:areaStyle {
[6613]133 throwOther: tr("Overlapping Areas");
134}
[6614]135
136/* see ticket #9311 */
[6628]137node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] *[amenity=parking] {
[6614]138 throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
[6680]139}
140
141/* see ticket #9556 */
142area:closed:areaStyle[tag("natural") = parent_tag("natural")] area:closed:areaStyle[natural] {
143 throwWarning: tr("Overlapping Identical Natural Areas");
144}
145
146area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] area:closed:areaStyle[landuse] {
147 throwWarning: tr("Overlapping Identical Landuses");
[6719]148}
149
150/* see ticket:#9522 */
151node[tag("amenity") = parent_tag("amenity")] *[amenity][amenity != parking] {
152 throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
153}
154node[tag("leisure") = parent_tag("leisure")] *[leisure] {
155 throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
156}
157node[tag("tourism") = parent_tag("tourism")] *[tourism] {
158 throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
159}
160node[tag("shop") = parent_tag("shop")] *[shop] {
161 throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
[6759]162}
163node[tag("power") = parent_tag("power")] *[power] {
164 throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
[7793]165}
166
[7807]167/* isolated nodes which should be part of a way, see #10825 */
[8522]168node:unconnected:in-downloaded-area[entrance],
169node:unconnected:in-downloaded-area[traffic_calming],
170node:unconnected:in-downloaded-area[highway=passing_place],
171node:unconnected:in-downloaded-area[highway=mini_roundabout],
172node:unconnected:in-downloaded-area[highway=motorway_junction],
173node:unconnected:in-downloaded-area[highway=turning_loop],
174node:unconnected:in-downloaded-area[highway=turning_circle],
175node:unconnected:in-downloaded-area[highway=stop],
176node:unconnected:in-downloaded-area[highway=give_way],
177node:unconnected:in-downloaded-area[highway=traffic_signals],
178node:unconnected:in-downloaded-area[highway=crossing],
179node:unconnected:in-downloaded-area[crossing],
180node:unconnected:in-downloaded-area[railway=crossing],
181node:unconnected:in-downloaded-area[railway=level_crossing],
182node:unconnected:in-downloaded-area[railway=buffer_stop],
183node:unconnected:in-downloaded-area[public_transport=stop_position],
184node:unconnected:in-downloaded-area[noexit],
185node:unconnected:in-downloaded-area[waterway=dam],
186node:unconnected:in-downloaded-area[waterway=weir],
187node:unconnected:in-downloaded-area[waterway=waterfall],
188node:unconnected:in-downloaded-area[amenity=ferry_terminal],
189node:unconnected:in-downloaded-area[mountain_pass=yes],
190node:unconnected:in-downloaded-area[barrier=gate],
191node:unconnected:in-downloaded-area[barrier=lift_gate],
192node:unconnected:in-downloaded-area[barrier=swing_gate],
193node:unconnected:in-downloaded-area[barrier=toll_booth],
194node:unconnected:in-downloaded-area[barrier=turnstile],
195node:unconnected:in-downloaded-area[barrier=full-height_turnstile],
196node:unconnected:in-downloaded-area[barrier=motorcycle_barrier],
197node:unconnected:in-downloaded-area[barrier=rope],
198node:unconnected:in-downloaded-area[barrier=sally_port],
199node:unconnected:in-downloaded-area[barrier=spikes],
200node:unconnected:in-downloaded-area[barrier=stile],
201node:unconnected:in-downloaded-area[barrier=sump_buster],
202node:unconnected:in-downloaded-area[barrier=kerb],
203node:unconnected:in-downloaded-area[barrier=border_control],
204node:unconnected:in-downloaded-area[barrier=bump_gate],
205node:unconnected:in-downloaded-area[barrier=bus_trap],
206node:unconnected:in-downloaded-area[barrier=cattle_grid],
207node:unconnected:in-downloaded-area[barrier=chain],
208node:unconnected:in-downloaded-area[barrier=cycle_barrier],
209node:unconnected:in-downloaded-area[barrier=hampshire_gate],
210node:unconnected:in-downloaded-area[barrier=height_restrictor],
211node:unconnected:in-downloaded-area[barrier=debris] {
[8589]212 throwWarning: tr("{0} must be connected to a way", "{2.tag}");
[8089]213}
214
215/*see #11127*/
216way[railway][bridge] > node,
217way[highway][bridge] > node {
218 set node_in_bridge;
219}
220way[waterway] > node.node_in_bridge {
221 throwWarning: tr("node connects waterway and bridge");
[9540]222}
223
224way[junction=roundabout]:righthandtraffic:clockwise,
225way[junction=roundabout]!:righthandtraffic:anticlockwise {
226 throwWarning: tr("suspicious roundabout direction");
[9843]227}
228
229/* #12496 */
230area:closed[place=islet][eval(areasize()) > 1500] {
231 throwWarning: tr("{0} on a large area", "{1.tag}");
232 suggestAlternative: "place=island";
233 fixAdd: "place=island";
234}
235
236area:closed[place=island][eval(areasize()) < 500] {
237 throwWarning: tr("{0} on a small area", "{1.tag}");
238 suggestAlternative: "place=islet";
239 fixAdd: "place=islet";
[7645]240}
Note: See TracBrowser for help on using the repository browser.