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

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

adjust/add area validator warnings

  • Property svn:eol-style set to native
File size: 11.1 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
[11049]77/* {0} on a node, should be a relation; Error level; see #10252, #10769 */
[7744]78node[route],
79node[restriction] {
[11049]80 throwError: tr("{0}=* on a node. Should be used in a relation", "{0.key}");
[7744]81}
82
[7942]83/* {0} on a way, should be a node */
[7960]84way[entrance],
[10429]85way[railway=subway_entrance],
[7960]86way[man_made=survey_point],
[11005]87way[aeroway=holding_position],
[9500]88way[power=transformer],
[7967]89way[power=pole],
[9494]90way[power=tower]!:closed,
[7977]91way[amenity=vending_machine],
[7942]92way[natural=peak],
93way[natural=saddle],
94way[natural=volcano],
95way[natural=tree] {
96 throwWarning: tr("{0} on a way. Should be used on a node.", "{0.tag}");
97}
98
[7744]99/* {0} on a way, should be a relation; see #10252 */
100way[route=bus] {
101 throwWarning: tr("{0} on a way. Should be used in a relation", "{0.tag}");
102}
103
[9745]104/* #12502 */
105node[leisure=park][natural=tree] {
106 throwWarning: tr("{0} together with {1} on a node. Remove {0}.", "{0.tag}", "{1.tag}");
[11146]107 group: tr("suspicious tag combination");
[9745]108 fixRemove: "leisure";
109}
110node[leisure=park][natural!=tree] {
111 throwWarning: tr("{0} on a node. Should be drawn as an area.", "{0.tag}");
112}
113
[7279]114/* see ticket:#10125 */
115node[source:geometry] {
116 throwWarning: tr("{0} on a node", "{0.key}");
117 fixChangeKey: "source:geometry => source:position";
118}
119
[6611]120/* Building inside building (spatial test) */
[7164]121*[building][building!~/no|entrance/][any(tag("layer"),"0") = any(parent_tag("layer"),"0")]
[6861]122*[building][building!~/no|entrance/] {
[6611]123 throwWarning: tr("Building inside building");
[6613]124}
125
126/* Overlapping areas (spatial test) */
127area[natural =~ /^(water|wetland|coastline)$/], area[landuse=reservoir] {
128 set water_area;
129}
130
[7280]131/* area:closed:areaStyle.water_area ⧉ area:closed:areaStyle.water_area -- does not work for now -- see ticket#10215 */
132area:closed:areaStyle[natural =~ /^(water|wetland|coastline)$/] area:closed:areaStyle.water_area,
133area:closed:areaStyle[landuse=reservoir] area:closed:areaStyle.water_area {
[6613]134 throwWarning: tr("Overlapping Water Areas");
135}
136
[6630]137area:closed:areaStyle area:closed:areaStyle {
[6613]138 throwOther: tr("Overlapping Areas");
139}
[6614]140
141/* see ticket #9311 */
[6628]142node[amenity=parking]["capacity:disabled" !~ /^(yes|[0-9]+)$/] *[amenity=parking] {
[6614]143 throwWarning: tr("{0} inside {1}", "amenity=parking", "amenity=parking");
[11353]144 group: tr("{0} inside {1}", "amenity", "amenity");
[6680]145}
146
147/* see ticket #9556 */
148area:closed:areaStyle[tag("natural") = parent_tag("natural")] area:closed:areaStyle[natural] {
149 throwWarning: tr("Overlapping Identical Natural Areas");
150}
151
152area:closed:areaStyle[tag("landuse") = parent_tag("landuse")] area:closed:areaStyle[landuse] {
153 throwWarning: tr("Overlapping Identical Landuses");
[6719]154}
155
156/* see ticket:#9522 */
157node[tag("amenity") = parent_tag("amenity")] *[amenity][amenity != parking] {
158 throwWarning: tr("{0} inside {1}", concat("amenity=", tag("amenity")), concat("amenity=", tag("amenity")));
[10710]159 group: tr("{0} inside {1}", "amenity", "amenity");
[6719]160}
161node[tag("leisure") = parent_tag("leisure")] *[leisure] {
162 throwWarning: tr("{0} inside {1}", concat("leisure=", tag("leisure")), concat("leisure=", tag("leisure")));
[10710]163 group: tr("{0} inside {1}", "leisure", "leisure");
[6719]164}
165node[tag("tourism") = parent_tag("tourism")] *[tourism] {
166 throwWarning: tr("{0} inside {1}", concat("tourism=", tag("tourism")), concat("tourism=", tag("tourism")));
[10710]167 group: tr("{0} inside {1}", "tourism", "tourism");
[6719]168}
169node[tag("shop") = parent_tag("shop")] *[shop] {
170 throwWarning: tr("{0} inside {1}", concat("shop=", tag("shop")), concat("shop=", tag("shop")));
[10710]171 group: tr("{0} inside {1}", "shop", "shop");
[6759]172}
173node[tag("power") = parent_tag("power")] *[power] {
174 throwWarning: tr("{0} inside {1}", concat("power=", tag("power")), concat("power=", tag("power")));
[10710]175 group: tr("{0} inside {1}", "power", "power");
[7793]176}
177
[7807]178/* isolated nodes which should be part of a way, see #10825 */
[8522]179node:unconnected:in-downloaded-area[entrance],
180node:unconnected:in-downloaded-area[traffic_calming],
181node:unconnected:in-downloaded-area[highway=passing_place],
182node:unconnected:in-downloaded-area[highway=mini_roundabout],
183node:unconnected:in-downloaded-area[highway=motorway_junction],
184node:unconnected:in-downloaded-area[highway=turning_loop],
185node:unconnected:in-downloaded-area[highway=turning_circle],
186node:unconnected:in-downloaded-area[highway=stop],
187node:unconnected:in-downloaded-area[highway=give_way],
188node:unconnected:in-downloaded-area[highway=traffic_signals],
189node:unconnected:in-downloaded-area[highway=crossing],
190node:unconnected:in-downloaded-area[crossing],
191node:unconnected:in-downloaded-area[railway=crossing],
192node:unconnected:in-downloaded-area[railway=level_crossing],
193node:unconnected:in-downloaded-area[railway=buffer_stop],
194node:unconnected:in-downloaded-area[public_transport=stop_position],
[11005]195node:unconnected:in-downloaded-area[aeroway=holding_position],
[8522]196node:unconnected:in-downloaded-area[noexit],
197node:unconnected:in-downloaded-area[waterway=dam],
198node:unconnected:in-downloaded-area[waterway=weir],
199node:unconnected:in-downloaded-area[waterway=waterfall],
200node:unconnected:in-downloaded-area[amenity=ferry_terminal],
[11133]201node:unconnected:in-downloaded-area[leisure=slipway],
[8522]202node:unconnected:in-downloaded-area[mountain_pass=yes],
203node:unconnected:in-downloaded-area[barrier=gate],
204node:unconnected:in-downloaded-area[barrier=lift_gate],
205node:unconnected:in-downloaded-area[barrier=swing_gate],
206node:unconnected:in-downloaded-area[barrier=toll_booth],
207node:unconnected:in-downloaded-area[barrier=turnstile],
208node:unconnected:in-downloaded-area[barrier=full-height_turnstile],
209node:unconnected:in-downloaded-area[barrier=motorcycle_barrier],
210node:unconnected:in-downloaded-area[barrier=rope],
211node:unconnected:in-downloaded-area[barrier=sally_port],
212node:unconnected:in-downloaded-area[barrier=spikes],
213node:unconnected:in-downloaded-area[barrier=stile],
214node:unconnected:in-downloaded-area[barrier=sump_buster],
215node:unconnected:in-downloaded-area[barrier=kerb],
216node:unconnected:in-downloaded-area[barrier=border_control],
217node:unconnected:in-downloaded-area[barrier=bump_gate],
218node:unconnected:in-downloaded-area[barrier=bus_trap],
219node:unconnected:in-downloaded-area[barrier=cattle_grid],
220node:unconnected:in-downloaded-area[barrier=chain],
221node:unconnected:in-downloaded-area[barrier=cycle_barrier],
222node:unconnected:in-downloaded-area[barrier=hampshire_gate],
223node:unconnected:in-downloaded-area[barrier=height_restrictor],
224node:unconnected:in-downloaded-area[barrier=debris] {
[11138]225 throwWarning: tr("{0}", "{2.tag}");
226 group: tr("isolated node which must be connected to a way");
[8089]227}
228
[11049]229/* #11127 */
[8089]230way[railway][bridge] > node,
231way[highway][bridge] > node {
232 set node_in_bridge;
233}
234way[waterway] > node.node_in_bridge {
235 throwWarning: tr("node connects waterway and bridge");
[9540]236}
237
[11049]238/* #11128 */
[10037]239way[highway] > node[tourism=information][information=guidepost] {
240 set guidepost;
241 throwOther: tr("{0} node connected to a highway", "{1.tag}");
242}
[10349]243way[highway] > node[amenity][!entrance][amenity!~/^(parking|parking_space|parking_entrance|motorcycle_parking|bicycle_parking|bus_station|car_wash|ferry_terminal)$/],
[10026]244way[highway] > node[building][!entrance],
[10272]245way[highway] > node[leisure][!entrance][leisure!=slipway],
[10026]246way[highway] > node[office][!entrance],
247way[highway] > node[shop][!entrance],
[10071]248way[highway] > node[tourism][!entrance][tourism!=viewpoint]!.guidepost {
[10028]249 throwWarning: tr("{0} node connected to a highway", "{0.key}");
[10026]250}
251
[9540]252way[junction=roundabout]:righthandtraffic:clockwise,
253way[junction=roundabout]!:righthandtraffic:anticlockwise {
254 throwWarning: tr("suspicious roundabout direction");
[9843]255}
256
257/* #12496 */
[10328]258area:closed[place=islet][eval(areasize()) > 1500000] {
[9843]259 throwWarning: tr("{0} on a large area", "{1.tag}");
260 suggestAlternative: "place=island";
261 fixAdd: "place=island";
262}
263
[10328]264area:closed[place=island][eval(areasize()) < 500000] {
[9843]265 throwWarning: tr("{0} on a small area", "{1.tag}");
266 suggestAlternative: "place=islet";
267 fixAdd: "place=islet";
[9985]268}
269
[11049]270/* #12561 - building larger than Aalsmeer Flower Auction (518000) and Tesla factory (510000) */
271area:closed[building][building!=no][eval(areasize()) > 520000] {
272 throwError: tr("Too large building");
[9985]273}
[10028]274
275/* #12577 */
276way[power=line] > node,
277way[power=minor_line] > node,
278way[power=cable] > node {
279 set node_in_power_way;
[10029]280}
[10028]281way[!power][!building] > node.node_in_power_way {
282 throwWarning: tr("Node connects a power line or cable with an object which is not related to the power infrastructure.");
[10029]283}
[10232]284
[10427]285/* #12646, #12992 */
[10530]286way[waterway=~/^(stream|ditch|river|drain)$/]!:closed >[index=-1] node[natural!=sinkhole][natural!=cave_entrance]!:connection:in-downloaded-area {
[10232]287 throwWarning: tr("Waterway ends without a connection to another waterway or the direction of the waterway is wrong.");
[10389]288}
289
290/* #10717 */
291way[natural=coastline] area[natural=water],
292way[natural=coastline] area[waterway=riverbank] {
293 throwError: tr("Coastline inside {1}", "{0.tag}");
[11146]294}
295
296/* #10471 */
297way[waterway] > node[ford?] { set ford_on_waterway; }
298way[highway] > node[ford?] { set ford_on_highway; }
299node[ford?]:in-downloaded-area!.ford_on_waterway, node[ford?]:in-downloaded-area!.ford_on_highway {
300 throwWarning: tr("{0} should be on the node where {1} and {2} intersect", "ford", "highway", "waterway");
[11232]301}
302/* #13877 */
303area:closed[waterway = canal][area!=no],
304area:closed[waterway = drain][area!=no],
305area:closed[waterway = ditch][area!=no],
306area:closed[waterway = stream][area!=no],
307area:closed[waterway = river][area!=no] {
308 throwWarning: tr("{0} is the tag for the linear waterway. To tag the water area use {1} + {2} instead.", "{1.tag}", "natural=water", "water=*");
[10232]309}
Note: See TracBrowser for help on using the repository browser.