forked from cxberlin/gravel-cartocss-style
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcyclosm.validator.mapcss
99 lines (81 loc) · 3.38 KB
/
cyclosm.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
/**
* Here are a few MapCSS validation rules for common mistakes we found while
* working on the CyclOSM render.
*
* See also:
* - https://github.com/osm-fr/osmose-backend/blob/master/plugins/Bicycle.validator.mapcss
* - https://josm.openstreetmap.de/browser/josm/trunk/data/validator/
*/
/*
* Highway=path suggestions
*/
way[highway=footway][bicycle=designated] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "highway=path";
assertMatch: "way highway=footway bicycle=designated";
assertNoMatch: "way highway=footway";
assertNoMatch: "way highway=footway bicycle=yes";
}
way[highway=cycleway][foot=designated] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "highway=path";
assertMatch: "way highway=cycleway foot=designated";
assertNoMatch: "way highway=cycleway";
assertNoMatch: "way highway=cycleway foot=yes";
}
way[highway=bridleway][bicycle=designated] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{1.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "highway=path";
assertMatch: "way highway=bridleway bicycle=designated";
assertNoMatch: "way highway=bridleway";
assertNoMatch: "way highway=bridleway bicycle=yes";
}
/*
* Two-ways for cars, oneway for bikes
*/
way[oneway][oneway!=yes][oneway:bicycle=yes] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{2.tag}");
group: tr("suspicious tag combination");
assertMatch: "way oneway=no oneway:bicycle=yes";
assertMatch: "way oneway=-1 oneway:bicycle=yes";
assertNoMatch: "way oneway:bicycle=yes";
assertNoMatch: "way oneway=yes oneway:bicycle=yes";
}
way[oneway][oneway!=-1][oneway:bicycle=-1] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{2.tag}");
group: tr("suspicious tag combination");
assertMatch: "way oneway=no oneway:bicycle=-1";
assertMatch: "way oneway=yes oneway:bicycle=-1";
assertNoMatch: "way oneway:bicycle=yes";
assertNoMatch: "way oneway=-1 oneway:bicycle=-1";
}
/*
* Potential error in bicycle parking access
*/
node[bicycle_parking=shed][access=customers] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{2.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "Do you mean access=private?";
assertMatch: "node bicycle_parking=shed access=customers";
assertNoMatch: "node bicycle_parking=shed access=private";
assertNoMatch: "node bicycle_parking=shed";
}
node[bicycle_parking=building][access=customers] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{2.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "Do you mean access=private?";
assertMatch: "node bicycle_parking=building access=customers";
assertNoMatch: "node bicycle_parking=building access=private";
assertNoMatch: "node bicycle_parking=building";
}
node[bicycle_parking=lockers][access=customers] {
throwWarning: tr("{0} together with {1}", "{0.tag}", "{2.tag}");
group: tr("suspicious tag combination");
suggestAlternative: "Do you mean access=private?";
assertMatch: "node bicycle_parking=lockers access=customers";
assertNoMatch: "node bicycle_parking=lockers access=private";
assertNoMatch: "node bicycle_parking=lockers";
}