source: josm/trunk/data/validator/highway.mapcss@ 15285

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

fix #17970 - don't warn about missing ref=* on highway=* if it is part of a type=route route=road relation which has a ref=*

  • Property svn:eol-style set to native
File size: 6.1 KB
Line 
1way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] {
2 set major_road;
3}
4way[highway=~/^.*_link$/] {
5 set link_road;
6}
7way[highway=~/^(unclassified|residential|living_street|service)$/] {
8 set minor_road;
9}
10
11way[highway][name =~ /(?i).* (Ave|Blvd|Br|Brg|Cct|Cir|Cl|Cr|Crct|Cres|Crt|Ct|Dr|Drv|Esp|Espl|Hwy|Ln|Mw|Mwy|Pky|Pkwy|Pl|Rd|Qy|Qys|Sq|St|Str|Ter|Tce|Tr|Wy)[.]?$/] {
12 throwWarning: tr("abbreviated street name");
13 assertMatch: "way highway=unclassified name=\"Foo Ave\"";
14 assertMatch: "way highway=unclassified name=\"Foo Ave.\"";
15 assertMatch: "way highway=unclassified name=\"Bou Blvd.\"";
16 assertMatch: "way highway=unclassified name=\"Bou blvd.\"";
17}
18
19node[highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|track|path|footway|cycleway|bus_guideway|bridleway/][highway!=motorway_junction][highway!=services] {
20 throwWarning: tr("wrong highway tag on a node");
21 assertMatch: "node highway=primary";
22 assertMatch: "node highway=primary_link";
23 assertNoMatch: "node highway=traffic_calming";
24 assertNoMatch: "node highway=bus_stop";
25 assertNoMatch: "node highway=crossing";
26 assertNoMatch: "node highway=emergency_access_point";
27 assertNoMatch: "node highway=give_way";
28 assertNoMatch: "node highway=mini_roundabout";
29 assertNoMatch: "node highway=motorway_junction";
30 assertNoMatch: "node highway=passing_place";
31 assertNoMatch: "node highway=rest_area";
32 assertNoMatch: "node highway=speed_camera";
33 assertNoMatch: "node highway=street_lamp";
34 assertNoMatch: "node highway=services";
35 assertNoMatch: "node highway=stop";
36 assertNoMatch: "node highway=traffic_signals";
37 assertNoMatch: "node highway=turning_circle";
38}
39
40way[highway=crossing],
41way[railway=crossing],
42way[railway=level_crossing] {
43 throwWarning: tr("wrong crossing tag on a way");
44 assertMatch: "way highway=crossing";
45 assertNoMatch: "node highway=crossing";
46}
47
48way[highway=unclassified][!name][noname!=yes] {
49 throwOther: tr("Unnamed unclassified highway");
50 assertMatch: "way highway=unclassified";
51 assertNoMatch: "way highway=unclassified noname=yes";
52 assertNoMatch: "way highway=unclassified name=Foo";
53}
54
55/* #17970 */
56relation[type=route][route=road][ref] > way.major_road {
57 set road_route_has_ref;
58}
59way.major_road!.road_route_has_ref[!ref][!destination:ref][noref!=yes][junction!=roundabout] {
60 throwOther: tr("highway without a reference");
61 group: tr("missing tag");
62 assertMatch: "way highway=primary";
63 assertNoMatch: "way highway=primary ref=123";
64 assertNoMatch: "way highway=primary destination:ref=123";
65 assertNoMatch: "way highway=primary noref=yes";
66}
67
68way[highway=yes],
69way[highway=road] {
70 throwWarning: tr("Unspecific highway type");
71 assertMatch: "way highway=road";
72 assertNoMatch: "way highway=residential";
73}
74
75way[highway=footway][maxspeed],
76way[highway=steps][maxspeed],
77way[highway=cycleway][bicycle=no],
78way[highway=footway][foot=no],
79way[highway=cycleway][cycleway=lane] {
80 throwWarning: tr("{0} used with {1}", "{0.value}", "{1.tag}");
81 assertNoMatch: "way highway=cycleway bicycle=yes";
82 assertNoMatch: "way highway=cycleway";
83 assertNoMatch: "way highway=footway foot=yes";
84 assertNoMatch: "way highway=footway";
85 assertMatch: "way highway=cycleway cycleway=lane";
86 assertNoMatch: "way highway=cycleway";
87 assertNoMatch: "way highway=residential cycleway=lane";
88 assertMatch: "way highway=footway maxspeed=20";
89 assertNoMatch: "way highway=residential maxspeed=20";
90 assertNoMatch: "way highway=footway";
91}
92
93/* footway, see #10851, #10976, #15439 */
94way[footway=left][/^footway:/],
95way[footway=right][/^footway:/],
96way[footway=both][/^footway:/],
97way[footway=no][/^footway:/] {
98 throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}");
99 group: tr("deprecated tagging");
100 set not_fixable_footway;
101 assertMatch: "way footway=both footway:surface=asphalt";
102}
103way[footway=none][/footway:/] {
104 throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}");
105 group: tr("deprecated tagging");
106 set not_fixable_footway;
107}
108way[footway=left]!.not_fixable_footway,
109way[footway=right]!.not_fixable_footway,
110way[footway=both]!.not_fixable_footway,
111way[footway=no]!.not_fixable_footway {
112 throwWarning: tr("{0} is deprecated", "{0.tag}");
113 suggestAlternative: "sidewalk";
114 group: tr("deprecated tagging");
115 fixChangeKey: "footway => sidewalk";
116 set fixable_footway;
117}
118way[footway=none]!.not_fixable_footway {
119 throwWarning: tr("{0} is deprecated", "{0.tag}");
120 suggestAlternative: "sidewalk=no";
121 group: tr("deprecated tagging");
122 fixRemove: "footway";
123 fixAdd: "sidewalk=no";
124 set fixable_footway;
125}
126way[footway][footway!=sidewalk][footway!=crossing]!.fixable_footway!.not_fixable_footway { /* do not trigger this rule if already one of the 4 previous rules applied */
127 throwWarning: tr("Value of ''{0}'' should either be ''{1}'' or ''{2}''. For sidewalks use ''{3}'' instead.", "{0.key}", "{1.value}", "{2.value}", "sidewalk=left|right|both|no");
128 assertNoMatch: "way footway=left";
129 assertNoMatch: "way footway=none";
130 assertNoMatch: "way footway=left footway:left:surface=asphalt";
131 assertMatch: "way footway=bar";
132}
133
134/* #11270, #9297, #15439, #16424 */
135way[railway =~ /^(light_rail|miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway }
136way[highway =~ /^(bridleway|cycleway|footway|path|steps)$/] > node { set .is_in_minor_road }
137way[highway =~ /^(bus_guideway|living_street|motorway|motorway_link|pedestrian|primary|primary_link|raceway|residential|road|secondary|secondary_link|service|tertiary|tertiary_link|track|trunk|trunk_link|unclassified)$/] > node { set .is_in_major_road }
138node[railway!=crossing][crossing!=no].is_in_railway.is_in_minor_road!.is_in_major_road {
139 throwWarning: tr("pedestrian railway crossing without {0}", "{0.tag}");
140 group: tr("missing tag");
141 fixAdd: "railway=crossing";
142}
143node[railway!=level_crossing].is_in_railway.is_in_major_road!.is_in_minor_road {
144 throwWarning: tr("railway crossing without {0}", "{0.tag}");
145 group: tr("missing tag");
146 fixAdd: "railway=level_crossing";
147}
Note: See TracBrowser for help on using the repository browser.