forked from osm-fr/osmose-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bicycle.validator.mapcss
115 lines (99 loc) · 5.06 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
/*#########################################################################
## ##
## 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}", "{0.key}", "{1.key}", "{2.key}");
-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/] {
throwWarning: tr("{0} without {1}", "{0.tag}", "highway=footway|construction");
-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 highway=construction construction=footway";
}
way[highway=service][service=psv][psv!=yes] {
throwWarning: tr("{0} is preferred to {1}", "{2.tag}", "{1.tag}");
-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}", "{0.tag}", "{1.tag}");
-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";
}