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

Last change on this file since 7880 was 7814, checked in by Klumbumbus, 9 years ago

see #10851 - add validator rules for footway=*

File size: 5.4 KB
Line 
1/* {0} on a node, should be a way */
2node[oneway],
3node[bridge?],
4node[sidewalk],
5node[footway],
6node[waterway=river],
7node[waterway=riverbank],
8node[waterway=canal],
9node[waterway=wadi],
10node[waterway=stream],
11node[waterway=ditch],
12node[natural=coastline],
13node[natural=ridge],
14node[natural=tree_row] {
15 throwWarning: tr("{0} on a node. Should be used on a way.", "{0.key}");
16 assertMatch: "node oneway=-1";
17 assertNoMatch: "way oneway=-1";
18 assertMatch: "node bridge=yes";
19 assertNoMatch: "node bridge=13";
20}
21
22/* {0} on a node, should be an area; see ticket #10679 */
23node[landuse],
24node[natural=scree],
25node[natural=scrub],
26node[natural=fell],
27node[natural=heath],
28node[natural=wood],
29node[natural=grassland],
30node[natural=wetland],
31node[natural=water],
32node[natural=mud],
33node[natural=beach],
34node[natural=sand],
35node[natural=wood],
36node[natural=bare_rock],
37node[waterway=riverbank],
38node[source:outline] {
39 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
40}
41
42/* {0} on a node, should be a relation; see #10252, #10769 */
43node[route],
44node[restriction] {
45 throwWarning: tr("{0}=* on a node. Should be used in a relation", "{0.key}");
46}
47
48/* {0} on a way, should be a relation; see #10252 */
49way[route=bus] {
50 throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}");
51}
52
53/* see ticket:#10125 */
54node[source:geometry] {
55 throwWarning: tr("{0} on a node", "{0.key}");
56 fixChangeKey: "source:geometry => source:position";
57}
58
59/* Building inside building (spatial test) */
60*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")]
61*[building][building!~/no|entrance/] {
62 throwWarning: tr("Building inside building");
63}
64
65/* Overlapping areas (spatial test) */
66area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
67 set water_area;
68}
69
70/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
71area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/] area:closed:areaStyle.water_area,
72area:closed:areaStyle[landuse=reservoir] area:closed:areaStyle.water_area {
73 throwWarning: tr("Overlapping Water Areas");
74}
75
76area:closed:areaStyle area:closed:areaStyle {
77 throwOther: tr("Overlapping Areas");
78}
79
80/* see ticket #9311 */
81node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] *[amenity=parking] {
82 throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
83}
84
85/* see ticket #9556 */
86area:closed:areaStyle[tag("natural") = parent_tag("natural")] area:closed:areaStyle[natural] {
87 throwWarning: tr("Overlapping Identical Natural Areas");
88}
89
90area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] area:closed:areaStyle[landuse] {
91 throwWarning: tr("Overlapping Identical Landuses");
92}
93
94/* see ticket:#9522 */
95node[tag("amenity") = parent_tag("amenity")] *[amenity][amenity != parking] {
96 throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
97}
98node[tag("leisure") = parent_tag("leisure")] *[leisure] {
99 throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
100}
101node[tag("tourism") = parent_tag("tourism")] *[tourism] {
102 throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
103}
104node[tag("shop") = parent_tag("shop")] *[shop] {
105 throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
106}
107node[tag("power") = parent_tag("power")] *[power] {
108 throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
109}
110
111/* isolated nodes which should be part of a way, see #10825 */
112node:unconnected[entrance],
113node:unconnected[traffic_calming],
114node:unconnected[highway=passing_place],
115node:unconnected[highway=mini_roundabout],
116node:unconnected[highway=motorway_junction],
117node:unconnected[highway=turning_loop],
118node:unconnected[highway=turning_circle],
119node:unconnected[highway=stop],
120node:unconnected[highway=give_way],
121node:unconnected[highway=traffic_signals],
122node:unconnected[highway=crossing],
123node:unconnected[crossing],
124node:unconnected[railway=crossing],
125node:unconnected[railway=level_crossing],
126node:unconnected[railway=buffer_stop],
127node:unconnected[public_transport=stop_position],
128node:unconnected[noexit],
129node:unconnected[waterway=dam],
130node:unconnected[waterway=weir],
131node:unconnected[waterway=waterfall],
132node:unconnected[amenity=ferry_terminal],
133node:unconnected[mountain_pass=yes],
134node:unconnected[barrier=gate],
135node:unconnected[barrier=lift_gate],
136node:unconnected[barrier=swing_gate],
137node:unconnected[barrier=toll_booth],
138node:unconnected[barrier=turnstile],
139node:unconnected[barrier=full-height_turnstile],
140node:unconnected[barrier=motorcycle_barrier],
141node:unconnected[barrier=rope],
142node:unconnected[barrier=sally_port],
143node:unconnected[barrier=spikes],
144node:unconnected[barrier=stile],
145node:unconnected[barrier=sump_buster],
146node:unconnected[barrier=kerb],
147node:unconnected[barrier=border_control],
148node:unconnected[barrier=bump_gate],
149node:unconnected[barrier=bus_trap],
150node:unconnected[barrier=cattle_grid],
151node:unconnected[barrier=chain],
152node:unconnected[barrier=cycle_barrier],
153node:unconnected[barrier=hampshire_gate],
154node:unconnected[barrier=height_restrictor],
155node:unconnected[barrier=debris] {
156 throwWarning: tr("{0} must be connected to a way", "{1.tag}");
157}
Note: See TracBrowser for help on using the repository browser.