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

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

see #9414 - MapCSS-based tagchecker: unify some checks

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