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

Last change on this file since 7737 was 7737, checked in by Klumbumbus, 10 years ago

Add validator warnings for linear waterway=* features on nodes. Deprecate waterway=water_point,waterway=waste_disposal and watermay=mooring in favor of amenity=water_point, amenity=waste_disposal and mooring=yes.

File size: 3.5 KB
Line 
1/* {0} on a node, should be a way */
2node[oneway],
3node[bridge?],
4node[sidewalk],
5node[waterway=river],
6node[waterway=riverbank],
7node[waterway=canal],
8node[waterway=wadi],
9node[waterway=stream],
10node[waterway=ditch],
11node[natural=coastline],
12node[natural=ridge],
13node[natural=tree_row] {
14 throwWarning: tr("{0} on a node. Should be used on a way.", "{0.key}");
15 assertMatch: "node oneway=-1";
16 assertNoMatch: "way oneway=-1";
17 assertMatch: "node bridge=yes";
18 assertNoMatch: "node bridge=13";
19}
20
21/* {0} on a node, should be an area; see ticket #10679 */
22node[landuse],
23node[natural=scree],
24node[natural=scrub],
25node[natural=fell],
26node[natural=heath],
27node[natural=wood],
28node[natural=grassland],
29node[natural=wetland],
30node[natural=water],
31node[natural=mud],
32node[natural=beach],
33node[natural=sand],
34node[natural=wood],
35node[natural=bare_rock],
36node[waterway=riverbank],
37node[source:outline] {
38 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
39}
40
41/* see ticket:#10125 */
42node[source:geometry] {
43 throwWarning: tr("{0} on a node", "{0.key}");
44 fixChangeKey: "source:geometry => source:position";
45}
46
47/* Building inside building (spatial test) */
48*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")]
49*[building][building!~/no|entrance/] {
50 throwWarning: tr("Building inside building");
51}
52
53/* Overlapping areas (spatial test) */
54area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
55 set water_area;
56}
57
58/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
59area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/] area:closed:areaStyle.water_area,
60area:closed:areaStyle[landuse=reservoir] area:closed:areaStyle.water_area {
61 throwWarning: tr("Overlapping Water Areas");
62}
63
64area:closed:areaStyle area:closed:areaStyle {
65 throwOther: tr("Overlapping Areas");
66}
67
68/* see ticket #9311 */
69node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] *[amenity=parking] {
70 throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
71}
72
73/* see ticket #9556 */
74area:closed:areaStyle[tag("natural") = parent_tag("natural")] area:closed:areaStyle[natural] {
75 throwWarning: tr("Overlapping Identical Natural Areas");
76}
77
78area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] area:closed:areaStyle[landuse] {
79 throwWarning: tr("Overlapping Identical Landuses");
80}
81
82/* see ticket:#9522 */
83node[tag("amenity") = parent_tag("amenity")] *[amenity][amenity != parking] {
84 throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
85}
86node[tag("leisure") = parent_tag("leisure")] *[leisure] {
87 throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
88}
89node[tag("tourism") = parent_tag("tourism")] *[tourism] {
90 throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
91}
92node[tag("shop") = parent_tag("shop")] *[shop] {
93 throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
94}
95node[tag("power") = parent_tag("power")] *[power] {
96 throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
97}
98
99/* see #10252 */
100way[route=bus] {
101 throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}");
102}
103node[route] {
104 throwWarning: tr("{0}=* on a node. Should be used in a relation", "{0.key}");
105}
Note: See TracBrowser for help on using the repository browser.