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

Last change on this file since 7942 was 7942, checked in by Klumbumbus, 5 years ago

see #10835 - icon unification and geometry consistency for some naturaltags. add validator warnings for some node features on ways

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