1 | way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] {
|
---|
2 | set major_road;
|
---|
3 | }
|
---|
4 | way[highway=~/^.*_link$/] {
|
---|
5 | set link_road;
|
---|
6 | }
|
---|
7 | way[highway=~/^(unclassified|residential|living_street|service)$/] {
|
---|
8 | set minor_road;
|
---|
9 | }
|
---|
10 |
|
---|
11 | way[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 |
|
---|
19 | node[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 |
|
---|
40 | way[highway=crossing],
|
---|
41 | way[railway=crossing],
|
---|
42 | way[railway=level_crossing] {
|
---|
43 | throwWarning: tr("wrong crossing tag on a way");
|
---|
44 | assertMatch: "way highway=crossing";
|
---|
45 | assertNoMatch: "node highway=crossing";
|
---|
46 | }
|
---|
47 |
|
---|
48 | way[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 | way.major_road[!ref][!destination:ref][noref!=yes][junction!=roundabout] {
|
---|
56 | throwOther: tr("highway without a reference");
|
---|
57 | group: tr("missing tag");
|
---|
58 | assertMatch: "way highway=primary";
|
---|
59 | assertNoMatch: "way highway=primary ref=123";
|
---|
60 | assertNoMatch: "way highway=primary destination:ref=123";
|
---|
61 | assertNoMatch: "way highway=primary noref=yes";
|
---|
62 | }
|
---|
63 |
|
---|
64 | way[highway=road] {
|
---|
65 | throwWarning: tr("Unspecific highway type");
|
---|
66 | assertMatch: "way highway=road";
|
---|
67 | assertNoMatch: "way highway=residential";
|
---|
68 | }
|
---|
69 |
|
---|
70 | way[highway=footway][maxspeed],
|
---|
71 | way[highway=steps][maxspeed],
|
---|
72 | way[highway=cycleway][bicycle=no],
|
---|
73 | way[highway=footway][foot=no],
|
---|
74 | way[highway=cycleway][cycleway=lane] {
|
---|
75 | throwWarning: tr("{0} used with {1}", "{0.value}", "{1.tag}");
|
---|
76 | assertNoMatch: "way highway=cycleway bicycle=yes";
|
---|
77 | assertNoMatch: "way highway=cycleway";
|
---|
78 | assertNoMatch: "way highway=footway foot=yes";
|
---|
79 | assertNoMatch: "way highway=footway";
|
---|
80 | assertMatch: "way highway=cycleway cycleway=lane";
|
---|
81 | assertNoMatch: "way highway=cycleway";
|
---|
82 | assertNoMatch: "way highway=residential cycleway=lane";
|
---|
83 | assertMatch: "way highway=footway maxspeed=20";
|
---|
84 | assertNoMatch: "way highway=residential maxspeed=20";
|
---|
85 | assertNoMatch: "way highway=footway";
|
---|
86 | }
|
---|
87 |
|
---|
88 | /* footway, see #10851, #10976, #15439 */
|
---|
89 | way[footway=left][/^footway:/],
|
---|
90 | way[footway=right][/^footway:/],
|
---|
91 | way[footway=both][/^footway:/],
|
---|
92 | way[footway=no][/^footway:/] {
|
---|
93 | throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}");
|
---|
94 | group: tr("deprecated tagging");
|
---|
95 | set not_fixable_footway;
|
---|
96 | assertMatch: "way footway=both footway:surface=asphalt";
|
---|
97 | }
|
---|
98 | way[footway=none][/footway:/] {
|
---|
99 | throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}");
|
---|
100 | group: tr("deprecated tagging");
|
---|
101 | set not_fixable_footway;
|
---|
102 | }
|
---|
103 | way[footway=left]!.not_fixable_footway,
|
---|
104 | way[footway=right]!.not_fixable_footway,
|
---|
105 | way[footway=both]!.not_fixable_footway,
|
---|
106 | way[footway=no]!.not_fixable_footway {
|
---|
107 | throwWarning: tr("{0} is deprecated", "{0.tag}");
|
---|
108 | suggestAlternative: "sidewalk";
|
---|
109 | group: tr("deprecated tagging");
|
---|
110 | fixChangeKey: "footway => sidewalk";
|
---|
111 | set fixable_footway;
|
---|
112 | }
|
---|
113 | way[footway=none]!.not_fixable_footway {
|
---|
114 | throwWarning: tr("{0} is deprecated", "{0.tag}");
|
---|
115 | suggestAlternative: "sidewalk=no";
|
---|
116 | group: tr("deprecated tagging");
|
---|
117 | fixRemove: "footway";
|
---|
118 | fixAdd: "sidewalk=no";
|
---|
119 | set fixable_footway;
|
---|
120 | }
|
---|
121 | way[footway][footway!=sidewalk][footway!=crossing]!.fixable_footway!.not_fixable_footway { /* do not trigger this rule if already one of the 4 previous rules applied */
|
---|
122 | 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");
|
---|
123 | assertNoMatch: "way footway=left";
|
---|
124 | assertNoMatch: "way footway=none";
|
---|
125 | assertNoMatch: "way footway=left footway:left:surface=asphalt";
|
---|
126 | assertMatch: "way footway=bar";
|
---|
127 | }
|
---|
128 |
|
---|
129 | /* #11270, #9297, #15439, #16424 */
|
---|
130 | way[railway =~ /^(light_rail|miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway }
|
---|
131 | way[highway =~ /^(bridleway|cycleway|footway|path|steps)$/] > node { set .is_in_minor_road }
|
---|
132 | way[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 }
|
---|
133 | node[railway!=crossing][crossing!=no].is_in_railway.is_in_minor_road!.is_in_major_road {
|
---|
134 | throwWarning: tr("pedestrian railway crossing without {0}", "{0.tag}");
|
---|
135 | group: tr("missing tag");
|
---|
136 | fixAdd: "railway=crossing";
|
---|
137 | }
|
---|
138 | node[railway!=level_crossing].is_in_railway.is_in_major_road!.is_in_minor_road {
|
---|
139 | throwWarning: tr("railway crossing without {0}", "{0.tag}");
|
---|
140 | group: tr("missing tag");
|
---|
141 | fixAdd: "railway=level_crossing";
|
---|
142 | }
|
---|