-
Notifications
You must be signed in to change notification settings - Fork 117
/
Copy pathBicycle.validator.mapcss
139 lines (121 loc) · 6.75 KB
/
Bicycle.validator.mapcss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*#########################################################################
## ##
## Copyrights Géovélo ##
## ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU General Public License as published by ##
## the Free Software Foundation, either version 3 of the License, or ##
## (at your option) any later version. ##
## ##
## This program is distributed in the hope that it will be useful, ##
## but WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ##
## GNU General Public License for more details. ##
## ##
## You should have received a copy of the GNU General Public License ##
## along with this program. If not, see <http://www.gnu.org/licenses/>. ##
## ##
#########################################################################*/
meta {
title: "Osmose-QA – Bike validation ruleset";
description: "Some validation for bike facilities";
author: "Géovélo";
min-josm-version: 14481;
-osmoseTags: list("tag", "highway");
}
meta[lang=en] { /* lang=en, unused, only to use tr() to catch string for translation */
description: tr("Some validation for bike facilities");
}
meta[lang=fr] {
description: "Règle de validation pour les aménagements cyclables";
}
way[busway=~/lane|opposite_lane/][!cycleway],
way[highway=service][psv=yes][access=no][!bicycle],
way[highway=service][psv=yes][motor_vehicle=no][!bicycle] {
throwOther: tr("Missing bicycle access in a busway: bicycle=yes|no");
-osmoseTags: list("cycleway", "fix:survey");
}
way[cycleway][cycleway:right][cycleway:left] {
throwWarning: tr("{0} with {1} and {2}", "cycleway", "cycleway:right", "cycleway:left");
-osmoseItemClassLevel: "4030/40301/2";
-osmoseTags: list("cycleway", "fix:chair");
assertMatch: "way cycleway=a cycleway:right=b cycleway:left=c";
}
way[footway=sidewalk][highway!~/footway|construction|proposed/][highway] {
throwWarning: tr("{0} without {1}", "footway=sidewalk", "highway=footway|construction|proposed");
-osmoseItemClassLevel: "2080/20805/3";
-osmoseTags: list("footway", "fix:chair");
assertMatch: "way footway=sidewalk highway=path";
assertNoMatch: "way footway=sidewalk highway=footway";
assertNoMatch: "way footway=sidewalk area:highway=footway";
assertNoMatch: "way footway=sidewalk highway=construction construction=footway";
assertNoMatch: "way footway=sidewalk highway=proposed proposed=footway";
}
way[highway=service][service=psv][psv!=yes] {
throwWarning: tr("{0} is preferred to {1}", "psv", "service=psv");
-osmoseItemClassLevel: "4010/40101/2";
-osmoseTags: list("fix:chair");
fixRemove: "service";
fixAdd: "psv=yes";
assertMatch: "way highway=service service=psv psv=no";
assertNoMatch: "way highway=service service=psv psv=yes";
}
way[highway=cycleway][cycleway=track] {
throwWarning: tr("{0} with {1}", "highway=cycleway", "cycleway=track");
-osmoseItemClassLevel: "3032/30328/2";
-osmoseTags: list("cycleway", "fix:chair");
fixRemove: "cycleway";
}
way[bicycle=~/no|use_sidepath/][cycleway][cycleway!~/no|none|separate/],
way[bicycle=~/no|use_sidepath/][cycleway:left][cycleway:left!~/no|none|separate/],
way[bicycle=~/no|use_sidepath/][cycleway:right][cycleway:right!~/no|none|separate/]
{
throwWarning: tr("{0} with {1}", "{0.tag}", "{1.tag}");
-osmoseItemClassLevel: "3032/30329/2";
-osmoseTags: list("fix:chair");
assertMatch: "way bicycle=no cycleway=track";
assertMatch: "way bicycle=use_sidepath cycleway:left=lane";
assertNoMatch: "way bicycle=no cycleway:right=no";
assertNoMatch: "way bicycle=use_sidepath cycleway:left=none";
assertNoMatch: "way highway=cycleway cycleway=separate";
assertNoMatch: "way highway=residential bicycle=use_sidepath";
}
way[cycleway=~/opposite|opposite_lane/][!oneway],
way[cycleway=~/opposite|opposite_lane/][oneway=no] {
throwError: tr("Opposite cycleway without oneway");
-osmoseItemClassLevel: "2030/20301/1";
-osmoseTags: list("cycleway", "fix:survey");
assertMatch: "way cycleway=opposite";
assertNoMatch: "way cycleway=opposite oneway=yes";
assertNoMatch: "way cycleway=lane oneway=yes";
}
way:righthandtraffic["cycleway:right"=~/opposite|opposite_lane/][oneway=yes],
way:righthandtraffic["cycleway:left"=~/opposite|opposite_lane/][oneway="-1"],
way!:righthandtraffic["cycleway:left"=~/opposite|opposite_lane/][oneway=yes],
way!:righthandtraffic["cycleway:right"=~/opposite|opposite_lane/][oneway="-1"] {
throwError: tr("Opposite or opposite lane in the same way of the oneway");
-osmoseItemClassLevel: "2030/20302/1";
-osmoseTags: list("cycleway", "fix:survey");
assertMatch: "way cycleway:right=opposite oneway=yes";
assertNoMatch: "way cycleway=opposite oneway=yes";
}
/* Warn about cycleway:lanes having incorrect values, e.g. confusion with bicycle:lanes */
/* Tolerate everything with a value of cycleway:lane (advisory/exclusive/pictogram) as there is no agreed upon scheme to tag lane-type-per-lane yet */
way[cycleway:lanes:forward][cycleway:lanes:forward!~/^((shared_lane|share_busway|no|none|lane|(\w|:)*(advisory|exclusive|pictogram)(\w|:)*)?(\||$))+$/],
way[cycleway:lanes:backward][cycleway:lanes:backward!~/^((shared_lane|share_busway|no|none|lane|(\w|:)*(advisory|exclusive|pictogram)(\w|:)*)?(\||$))+$/],
way[cycleway:lanes][cycleway:lanes!~/^((shared_lane|share_busway|no|none|lane|(\w|:)*(advisory|exclusive|pictogram)(\w|:)*)?(\||$))+$/] {
throwWarning: tr("Uncommon value of {0}", "{0.key}");
-osmoseItemClassLevel: "3160/316020/3";
-osmoseTags: list("cycleway", "fix:survey");
assertMatch: "way cycleway:lanes=4";
assertMatch: "way cycleway:lanes=no|designated";
assertMatch: "way cycleway:lanes=no|designated|";
assertMatch: "way cycleway:lanes=no|lane|designated";
assertMatch: "way cycleway:lanes=no|lane|designated|";
assertNoMatch: "way cycleway:lanes=no|lane|shared_lane";
assertNoMatch: "way cycleway:lanes=|lane|";
assertNoMatch: "way cycleway:lanes=lane|||";
assertNoMatch: "way cycleway:lanes=|shared_lane";
assertNoMatch: "way cycleway:lanes=lane note=single_lane";
assertNoMatch: "way cycleway:lanes=lane|advisory_lane|lane_exclusive||lane:exclusive|no"; /* tolerate everything with lane specifics */
}