source: josm/trunk/resources/data/validator/highway.mapcss@ 19276

Last change on this file since 19276 was 19273, checked in by stoecker, 4 weeks ago

fix #24054 - no longer silently ignore identical or mismatching asserts in mapcss tag checker

  • Property svn:eol-style set to native
File size: 11.6 KB
RevLine 
[7281]1way[highway=~/^(motorway|trunk|primary|secondary|tertiary)$/] {
[6601]2 set major_road;
3}
[7281]4way[highway=~/^.*_link$/] {
5 set link_road;
6}
[6601]7way[highway=~/^(unclassified|residential|living_street|service)$/] {
8 set minor_road;
9}
10
[17388]11/* r3669, #9384, #20117 */
12way[highway][name =~ /(?i).* (Ave|Blvd|Bnd|Br|Brg|Cct|Cir|Cl|Cr|Crct|Cres|Crt|Ct|Cv|Dr|Drv|Esp|Espl|Hwy|Ln|Mw|Mwy|Pky|Pkwy|Pl|Rd|Qy|Qys|Sq|St|Str|Ter|Tce|Tr|Trl|Vw|Wy|Xing)[.]?$/] {
[6513]13 throwWarning: tr("abbreviated street name");
14 assertMatch: "way highway=unclassified name=\"Foo Ave\"";
15 assertMatch: "way highway=unclassified name=\"Foo Ave.\"";
16 assertMatch: "way highway=unclassified name=\"Bou Blvd.\"";
17 assertMatch: "way highway=unclassified name=\"Bou blvd.\"";
18}
19
[18112]20node[highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|track|path|footway|cycleway|busway|bus_guideway|bridleway/][highway!=motorway_junction][highway!=services] {
[6513]21 throwWarning: tr("wrong highway tag on a node");
22 assertMatch: "node highway=primary";
23 assertMatch: "node highway=primary_link";
[6516]24 assertNoMatch: "node highway=traffic_calming";
25 assertNoMatch: "node highway=bus_stop";
[6513]26 assertNoMatch: "node highway=crossing";
[6516]27 assertNoMatch: "node highway=emergency_access_point";
28 assertNoMatch: "node highway=give_way";
29 assertNoMatch: "node highway=mini_roundabout";
30 assertNoMatch: "node highway=motorway_junction";
31 assertNoMatch: "node highway=passing_place";
32 assertNoMatch: "node highway=rest_area";
33 assertNoMatch: "node highway=speed_camera";
34 assertNoMatch: "node highway=street_lamp";
35 assertNoMatch: "node highway=services";
36 assertNoMatch: "node highway=stop";
37 assertNoMatch: "node highway=traffic_signals";
38 assertNoMatch: "node highway=turning_circle";
[6513]39}
40
[7977]41way[highway=crossing],
42way[railway=crossing],
43way[railway=level_crossing] {
[6513]44 throwWarning: tr("wrong crossing tag on a way");
45 assertMatch: "way highway=crossing";
46 assertNoMatch: "node highway=crossing";
47}
48
[15312]49/* #18060 */
50node[footway=crossing] {
51 throwWarning: tr("{0} on a node", "{0.tag}");
52 suggestAlternative: "highway=crossing";
53 suggestAlternative: "railway=crossing";
54}
55node[cycleway=crossing] {
56 throwWarning: tr("{0} on a node", "{0.tag}");
57 suggestAlternative: "highway=crossing + bicycle=yes";
58 suggestAlternative: "railway=crossing + bicycle=yes";
59}
60
[7932]61way[highway=unclassified][!name][noname!=yes] {
[6513]62 throwOther: tr("Unnamed unclassified highway");
63 assertMatch: "way highway=unclassified";
[7932]64 assertNoMatch: "way highway=unclassified noname=yes";
[6513]65 assertNoMatch: "way highway=unclassified name=Foo";
66}
67
[15285]68/* #17970 */
69relation[type=route][route=road][ref] > way.major_road {
70 set road_route_has_ref;
71}
72way.major_road!.road_route_has_ref[!ref][!destination:ref][noref!=yes][junction!=roundabout] {
[6513]73 throwOther: tr("highway without a reference");
[11146]74 group: tr("missing tag");
[6513]75 assertMatch: "way highway=primary";
76 assertNoMatch: "way highway=primary ref=123";
[11337]77 assertNoMatch: "way highway=primary destination:ref=123";
[12194]78 assertNoMatch: "way highway=primary noref=yes";
[6513]79}
80
[14354]81way[highway=yes],
[6513]82way[highway=road] {
[12418]83 throwWarning: tr("Unspecific highway type");
[6513]84 assertMatch: "way highway=road";
85 assertNoMatch: "way highway=residential";
86}
87
[6550]88way[highway=footway][maxspeed],
89way[highway=steps][maxspeed],
[7819]90way[highway=cycleway][bicycle=no],
91way[highway=footway][foot=no],
[6550]92way[highway=cycleway][cycleway=lane] {
[16678]93 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
[19273]94 assertMatch: "way highway=cycleway cycleway=lane";
95 assertMatch: "way highway=footway maxspeed=20";
[6513]96 assertNoMatch: "way highway=cycleway bicycle=yes";
97 assertNoMatch: "way highway=cycleway";
98 assertNoMatch: "way highway=footway foot=yes";
99 assertNoMatch: "way highway=footway";
100 assertNoMatch: "way highway=residential cycleway=lane";
101 assertNoMatch: "way highway=residential maxspeed=20";
102}
103
[18523]104/* footway, see #10851, #10976, #15439, #19389, #21235 */
[13005]105way[footway=left][/^footway:/],
106way[footway=right][/^footway:/],
107way[footway=both][/^footway:/],
[18523]108way[footway=separate][/^footway:/],
[13005]109way[footway=no][/^footway:/] {
[11364]110 throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk", "{1.key}");
111 group: tr("deprecated tagging");
112 set not_fixable_footway;
113 assertMatch: "way footway=both footway:surface=asphalt";
[18523]114 assertMatch: "way footway=separate footway:surface=asphalt";
[11364]115}
[18523]116way[footway=none][/^footway:/] {
[11364]117 throwWarning: tr("{0} is deprecated, use {1} instead. Also check similar tags like {2}", "{0.tag}", "sidewalk=no", "{1.key}");
118 group: tr("deprecated tagging");
119 set not_fixable_footway;
[18523]120 assertMatch: "way footway=none footway:surface=asphalt";
121 assertNoMatch: "way footway=no footway:surface=asphalt";
[11364]122}
[18523]123
[11364]124way[footway=left]!.not_fixable_footway,
125way[footway=right]!.not_fixable_footway,
126way[footway=both]!.not_fixable_footway,
[18523]127way[footway=separate]!.not_fixable_footway,
[11364]128way[footway=no]!.not_fixable_footway {
[7814]129 throwWarning: tr("{0} is deprecated", "{0.tag}");
130 suggestAlternative: "sidewalk";
[11139]131 group: tr("deprecated tagging");
[7814]132 fixChangeKey: "footway => sidewalk";
[11364]133 set fixable_footway;
[7814]134}
[18523]135
[11364]136way[footway=none]!.not_fixable_footway {
[7814]137 throwWarning: tr("{0} is deprecated", "{0.tag}");
138 suggestAlternative: "sidewalk=no";
[11139]139 group: tr("deprecated tagging");
[7814]140 fixRemove: "footway";
141 fixAdd: "sidewalk=no";
[11364]142 set fixable_footway;
[7814]143}
[9839]144
[15314]145/* #11270, #9297, #15439, #16424, #17022 */
146way[railway =~ /^(miniature|narrow_gauge|preserved|rail)$/][!highway] > node { set .is_in_railway }
[12595]147way[highway =~ /^(bridleway|cycleway|footway|path|steps)$/] > node { set .is_in_minor_road }
[18112]148way[highway =~ /^(busway|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 }
[13977]149node[railway!=crossing][crossing!=no].is_in_railway.is_in_minor_road!.is_in_major_road {
[9839]150 throwWarning: tr("pedestrian railway crossing without {0}", "{0.tag}");
[11146]151 group: tr("missing tag");
[9839]152 fixAdd: "railway=crossing";
153}
[12595]154node[railway!=level_crossing].is_in_railway.is_in_major_road!.is_in_minor_road {
[9839]155 throwWarning: tr("railway crossing without {0}", "{0.tag}");
[11146]156 group: tr("missing tag");
[9839]157 fixAdd: "railway=level_crossing";
[15648]158}
159
160node[highway=crossing][barrier=kerb].is_in_major_road {
161 throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
162 suggestAlternative: "kerb=*";
163 group: tr("suspicious tag combination");
[17935]164}
165
166/* #20987 */
[17937]167way[turn ][turn !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
168way[turn:forward ][turn:forward !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
169way[turn:backward ][turn:backward !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
170way[turn:both_ways ][turn:both_ways !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
171way[turn:both_ways:forward ][turn:both_ways:forward !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
172way[turn:both_ways:backward ][turn:both_ways:backward !~ /^(none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)$/],
[18022]173way[turn:lanes ][turn:lanes !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
174way[turn:lanes:forward ][turn:lanes:forward !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
175way[turn:lanes:backward ][turn:lanes:backward !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
176way[turn:lanes:both_ways ][turn:lanes:both_ways !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
177way[turn:lanes:both_ways:forward ][turn:lanes:both_ways:forward !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/],
178way[turn:lanes:both_ways:backward][turn:lanes:both_ways:backward !~ /^(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*)(\|(|none|((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through)(;((sharp_|slight_|merge_to_|slide_)?(left|right)|reverse|through))*))*$/] {
[17935]179 throwWarning: tr("unusual value of {0}", "{0.key}");
180 assertMatch: "way turn=straight"; /* through would be correct */
181 assertMatch: "way turn=slight_reverse"; /* wrong value */
182 assertMatch: "way turn=through|right"; /* :lanes missing in key */
183 assertNoMatch: "way turn=through;right";
184 assertMatch: "way turn:lanes:forward=straight|right"; /* through would be correct */
185 assertMatch: "way turn:lanes:forward=slight_reverse|right"; /* wrong value */
[17937]186 assertMatch: "way turn:lanes=left;none|right"; /* "none" needs to be a solo value */
[18022]187 assertNoMatch: "way turn:lanes:forward=sharp_left;left||left;through;slight_right|slight_right;right|";
[17941]188}
189
190/* #20442 traffic signals or similar on roundabouts */
191node[highway=traffic_signals ][ traffic_signals=signal] < way[highway][junction=roundabout],
192node[highway=~/^(traffic_signals|stop|give_way)$/][!traffic_signals ] < way[highway][junction=roundabout] {
193 throwWarning: tr("{0} without right of way", "{1.tag}");
194 suggestAlternative: "junction=circular";
[18022]195}
[18104]196
197/* #18217 */
198way[highway =~ /^((motorway|trunk|primary|secondary|tertiary)(_link)?|residential|unclassified)$/][area=yes],
199relation[highway =~ /^((motorway|trunk|primary|secondary|tertiary)(_link)?|residential|unclassified)$/][type=multipolygon] {
200 throwError: tr("Area with {0} above {1} is invalid", "highway=*", "highway=service");
201 group: tr("suspicious tag combination");
202 suggestAlternative: "area:highway=*";
203 assertMatch: "way highway=trunk area=yes";
204 assertMatch: "relation highway=trunk type=multipolygon";
205 assertNoMatch: "way highway=service area=yes";
206 assertNoMatch: "way highway=trunk";
207}
[18552]208
209/* #21396 comment 39 */
210*[surface=~/^paving_stones:(\d+)$/] {
211 throwWarning: tr("{0} with trailing number", "paving_stones");
212 group: tr("questionable value (ending with a number)");
213 suggestAlternative: "paving_stones:length";
214 suggestAlternative: "paving_stones:width";
[19273]215}
Note: See TracBrowser for help on using the repository browser.