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

Last change on this file since 6549 was 6549, checked in by simon04, 10 years ago

fix #9379 - Add validator warning: "foot used with highway=motorway|trunk|primary|secondary|tertiary, use sidewalk or separate footway instead"

File size: 4.1 KB
Line 
1way[highway][name =~ /(?i).* (Ave|Blvd|Br|Brg|Cct|Cir|Cl|Cr|Crct|Cres|Crt|Ct|Dr|Drv|Esp|Espl|Hwy|Ln|Mw|Mwy|Pl|Rd|Qy|Qys|Sq|St|Str|Ter|Tce|Tr|Wy)[.]?$/] {
2 throwWarning: tr("abbreviated street name");
3 assertMatch: "way highway=unclassified name=\"Foo Ave\"";
4 assertMatch: "way highway=unclassified name=\"Foo Ave.\"";
5 assertMatch: "way highway=unclassified name=\"Bou Blvd.\"";
6 assertMatch: "way highway=unclassified name=\"Bou blvd.\"";
7}
8
9node[oneway] {
10 throwWarning: tr("oneway tag on a node");
11 assertMatch: "node oneway=-1";
12 assertNoMatch: "way oneway=-1";
13}
14
15node[bridge?] {
16 throwWarning: tr("bridge tag on a node");
17 assertMatch: "node bridge=yes";
18 assertNoMatch: "node bridge=13";
19}
20
21node[highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|track|path|footway/][highway!=motorway_junction][highway!=services] {
22 throwWarning: tr("wrong highway tag on a node");
23 assertMatch: "node highway=primary";
24 assertMatch: "node highway=primary_link";
25 assertNoMatch: "node highway=traffic_calming";
26 assertNoMatch: "node highway=bus_stop";
27 assertNoMatch: "node highway=crossing";
28 assertNoMatch: "node highway=emergency_access_point";
29 assertNoMatch: "node highway=give_way";
30 assertNoMatch: "node highway=mini_roundabout";
31 assertNoMatch: "node highway=motorway_junction";
32 assertNoMatch: "node highway=passing_place";
33 assertNoMatch: "node highway=rest_area";
34 assertNoMatch: "node highway=speed_camera";
35 assertNoMatch: "node highway=street_lamp";
36 assertNoMatch: "node highway=services";
37 assertNoMatch: "node highway=stop";
38 assertNoMatch: "node highway=traffic_signals";
39 assertNoMatch: "node highway=turning_circle";
40}
41
42way[highway=crossing], way[railway=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] {
49 throwOther: tr("Unnamed unclassified highway");
50 assertMatch: "way highway=unclassified";
51 assertNoMatch: "way highway=unclassified name=Foo";
52}
53
54way[highway =~ /motorway|trunk|primary|secondary|tertiary/][!ref] {
55 throwOther: tr("highway without a reference");
56 assertMatch: "way highway=primary";
57 assertNoMatch: "way highway=primary ref=123";
58}
59
60way[foot][highway =~ /motorway|trunk|primary|secondary|tertiary/] {
61 throwWarning: tr("{0} used with {1}", "{0.key}", "{1.tag}");
62 suggestAlternative: "sidewalk";
63 suggestAlternative: "separate footway";
64 assertMatch: "way highway=primary foot=yes";
65 assertNoMatch: "way highway=primary";
66}
67
68way[highway=road] {
69 throwWarning: tr("temporary highway type");
70 assertMatch: "way highway=road";
71 assertNoMatch: "way highway=residential";
72}
73
74way[highway=cycleway][bicycle?!] {
75 throwWarning: tr("cycleway with tag bicycle");
76 assertMatch: "way highway=cycleway bicycle=false";
77 assertMatch: "way highway=cycleway bicycle=0";
78 assertNoMatch: "way highway=cycleway bicycle=yes";
79 assertNoMatch: "way highway=cycleway";
80}
81
82way[highway=footway][foot?!] {
83 throwWarning: tr("footway with tag foot");
84 assertMatch: "way highway=footway foot=false";
85 assertMatch: "way highway=footway foot=0";
86 assertNoMatch: "way highway=footway foot=yes";
87 assertNoMatch: "way highway=footway";
88}
89
90way[highway=cycleway][cycleway=lane] {
91 throwWarning: tr("separate cycleway as lane on a cycleway");
92 assertMatch: "way highway=cycleway cycleway=lane";
93 assertNoMatch: "way highway=cycleway";
94 assertNoMatch: "way highway=residential cycleway=lane";
95}
96
97way[highway][barrier] {
98 throwWarning: tr("barrier used on a way");
99 assertMatch: "way highway=residential barrier=hedge";
100 assertNoMatch: "way highway=residential";
101 assertNoMatch: "way barrier=hedge";
102}
103
104way[highway=footway][maxspeed], way[highway=steps][maxspeed] {
105 throwWarning: tr("maxspeed used for footway");
106 assertMatch: "way highway=footway maxspeed=20";
107 assertNoMatch: "way highway=residential maxspeed=20";
108 assertNoMatch: "way highway=footway";
109}
110
111*[name =~ /(?i).*Strasse.*/] {
112 throwWarning: tr("street name contains ss");
113 assertMatch: "way name=Foobarstrasse";
114 assertMatch: "way name=Foobar-Strassenweg";
115 assertNoMatch: "way name=Foobarstraße";
116}
Note: See TracBrowser for help on using the repository browser.