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

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