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

Last change on this file since 6632 was 6632, checked in by simon04, 6 years ago

fix #9379 - warn foot on major roads only if foot=yes and sidewalk is missing

File size: 3.7 KB
Line 
1way[highway=~/^(motorway|trunk|primary|secondary|tertiary)(_link)?$/] {
2  set major_road;
3}
4way[highway=~/^(unclassified|residential|living_street|service)$/] {
5  set minor_road;
6}
7
8way[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)[.]?$/] {
9  throwWarning: tr("abbreviated street name");
10  assertMatch: "way highway=unclassified name=\"Foo Ave\"";
11  assertMatch: "way highway=unclassified name=\"Foo Ave.\"";
12  assertMatch: "way highway=unclassified name=\"Bou Blvd.\"";
13  assertMatch: "way highway=unclassified name=\"Bou blvd.\"";
14}
15
16node[highway =~ /motorway|trunk|primary|secondary|tertiary|unclassified|residential|service|living_street|pedestrian|track|path|footway/][highway!=motorway_junction][highway!=services] {
17  throwWarning: tr("wrong highway tag on a node");
18  assertMatch: "node highway=primary";
19  assertMatch: "node highway=primary_link";
20  assertNoMatch: "node highway=traffic_calming";
21  assertNoMatch: "node highway=bus_stop";
22  assertNoMatch: "node highway=crossing";
23  assertNoMatch: "node highway=emergency_access_point";
24  assertNoMatch: "node highway=give_way";
25  assertNoMatch: "node highway=mini_roundabout";
26  assertNoMatch: "node highway=motorway_junction";
27  assertNoMatch: "node highway=passing_place";
28  assertNoMatch: "node highway=rest_area";
29  assertNoMatch: "node highway=speed_camera";
30  assertNoMatch: "node highway=street_lamp";
31  assertNoMatch: "node highway=services";
32  assertNoMatch: "node highway=stop";
33  assertNoMatch: "node highway=traffic_signals";
34  assertNoMatch: "node highway=turning_circle";
35}
36
37way[highway=crossing], way[railway=crossing] {
38  throwWarning: tr("wrong crossing tag on a way");
39  assertMatch: "way highway=crossing";
40  assertNoMatch: "node highway=crossing";
41}
42
43way[highway=unclassified][!name] {
44  throwOther: tr("Unnamed unclassified highway");
45  assertMatch: "way highway=unclassified";
46  assertNoMatch: "way highway=unclassified name=Foo";
47}
48
49way.major_road[!ref] {
50  throwOther: tr("highway without a reference");
51  assertMatch: "way highway=primary";
52  assertNoMatch: "way highway=primary ref=123";
53}
54
55way.major_road[foot?][!sidewalk] {
56  throwWarning: tr("{0} used with {1}", tr("major road"), "{0.tag}");
57  suggestAlternative: "sidewalk";
58  suggestAlternative: tr("separate footway");
59  assertMatch: "way highway=primary foot=yes";
60  assertNoMatch: "way highway=primary";
61  assertNoMatch: "way highway=primary foot=yes sidewalk=both";
62  assertNoMatch: "way highway=primary foot=no";
63}
64
65way[highway=road] {
66  throwWarning: tr("temporary highway type");
67  assertMatch: "way highway=road";
68  assertNoMatch: "way highway=residential";
69}
70
71way[highway=footway][maxspeed],
72way[highway=steps][maxspeed],
73way[highway=cycleway][bicycle?!],
74way[highway=footway][foot?!],
75way[highway=cycleway][cycleway=lane] {
76  throwWarning: tr("{0} used with {1}", "{0.value}", "{1.tag}");
77  assertMatch: "way highway=cycleway bicycle=false";
78  assertMatch: "way highway=cycleway bicycle=0";
79  assertNoMatch: "way highway=cycleway bicycle=yes";
80  assertNoMatch: "way highway=cycleway";
81  assertMatch: "way highway=footway foot=false";
82  assertMatch: "way highway=footway foot=0";
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*[name =~ /(?i).*Strasse.*/] {
94  throwWarning: tr("street name contains ss");
95  assertMatch: "way name=Foobarstrasse";
96  assertMatch: "way name=Foobar-Strassenweg";
97  assertNoMatch: "way name=Foobarstraße";
98}
Note: See TracBrowser for help on using the repository browser.