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

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

see #9414 fix #9485 - MapCSSTagChecker: add support for set class_name instruction and .class_name condition

File size: 3.6 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] {
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}
62
63way[highway=road] {
64 throwWarning: tr("temporary highway type");
65 assertMatch: "way highway=road";
66 assertNoMatch: "way highway=residential";
67}
68
69way[highway=footway][maxspeed],
70way[highway=steps][maxspeed],
71way[highway=cycleway][bicycle?!],
72way[highway=footway][foot?!],
73way[highway=cycleway][cycleway=lane] {
74 throwWarning: tr("{0} used with {1}", "{0.value}", "{1.tag}");
75 assertMatch: "way highway=cycleway bicycle=false";
76 assertMatch: "way highway=cycleway bicycle=0";
77 assertNoMatch: "way highway=cycleway bicycle=yes";
78 assertNoMatch: "way highway=cycleway";
79 assertMatch: "way highway=footway foot=false";
80 assertMatch: "way highway=footway foot=0";
81 assertNoMatch: "way highway=footway foot=yes";
82 assertNoMatch: "way highway=footway";
83 assertMatch: "way highway=cycleway cycleway=lane";
84 assertNoMatch: "way highway=cycleway";
85 assertNoMatch: "way highway=residential cycleway=lane";
86 assertMatch: "way highway=footway maxspeed=20";
87 assertNoMatch: "way highway=residential maxspeed=20";
88 assertNoMatch: "way highway=footway";
89}
90
91*[name =~ /(?i).*Strasse.*/] {
92 throwWarning: tr("street name contains ss");
93 assertMatch: "way name=Foobarstrasse";
94 assertMatch: "way name=Foobar-Strassenweg";
95 assertNoMatch: "way name=Foobarstraße";
96}
Note: See TracBrowser for help on using the repository browser.