Skip to content

Commit 491f428

Browse files
committed
use cycleway tag alongside :both/left/right
cycleway=separate would mean inaccessible in osrm for transition
1 parent a7287b3 commit 491f428

File tree

11 files changed

+118
-35
lines changed

11 files changed

+118
-35
lines changed

css/30_highways.css

+7
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,13 @@ svg#surface:not(.debug-surfaces) path.over-stroke.tag-crossing.tag-name-no {
977977
stroke-linecap: butt !important;
978978
}
979979

980+
/* cycleway separate (no biicycle access) */
981+
svg#surface:not(.debug-surfaces) path.over-stroke.tag-cycleway-separate,
982+
svg#surface:not(.debug-surfaces) path.over-stroke.tag-cycleway_both-separate {
983+
stroke-width: 1 !important;
984+
stroke: rgb(255, 0, 0) !important;
985+
stroke-linecap: butt !important;
986+
}
980987

981988
/* turn lanes */
982989
svg#surface:not(.debug-surfaces) path.over-stroke.tag-turn_lanes-yes {

data/presets/fields/cycleway.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
11
{
2-
"keys": ["cycleway:both", "cycleway:left", "cycleway:right"],
2+
"keys": ["cycleway", "cycleway:both", "cycleway:left", "cycleway:right"],
33
"reference": {"key": "cycleway"},
44
"type": "cycleway",
55
"label": "Bike Lanes",
66
"placeholder": "none",
77
"strings": {
88
"types": {
9-
"cycleway:both": "Both sides",
9+
"cycleway": "Cycleway",
10+
"cycleway:both": "Both sides (:both)",
1011
"cycleway:left": "Left side",
1112
"cycleway:right": "Right side"
1213
},
1314
"options": {
14-
"none": {
15-
"title": "None",
15+
"separate": {
16+
"title": "Bike track drawned separately",
17+
"description": "A bike lane separated from traffic by a physical barrier is drawned as its own separate way"
18+
},
19+
"no": {
20+
"title": "No",
1621
"description": "No bike lane"
1722
},
1823
"lane": {
1924
"title": "Standard bike lane",
2025
"description": "A bike lane separated from auto traffic by a painted line"
2126
},
22-
"separate": {
23-
"title": "Bike track drawned separately",
24-
"description": "A bike lane separated from traffic by a physical barrier is drawned as its own separate way"
25-
},
2627
"shared_lane": {
2728
"title": "Shared bike lane",
2829
"description": "A bike lane with no separation from auto traffic"

dist/iD.css

+7
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,13 @@ svg#surface:not(.debug-surfaces) path.over-stroke.tag-crossing.tag-name-no {
19281928
stroke-linecap: butt !important;
19291929
}
19301930

1931+
/* cycleway separate (no biicycle access) */
1932+
svg#surface:not(.debug-surfaces) path.over-stroke.tag-cycleway-separate,
1933+
svg#surface:not(.debug-surfaces) path.over-stroke.tag-cycleway_both-separate {
1934+
stroke-width: 1 !important;
1935+
stroke: rgb(255, 0, 0) !important;
1936+
stroke-linecap: butt !important;
1937+
}
19311938

19321939
/* turn lanes */
19331940
svg#surface:not(.debug-surfaces) path.over-stroke.tag-turn_lanes-yes {

dist/iD.js

+47-13
Large diffs are not rendered by default.

dist/iD.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iD.min.js

+1-1
Large diffs are not rendered by default.

modules/actions/clone_road_attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function actionCloneRoadAttributes(selectedIds, cloneTags = [], languageS
1414
'bus:lanes:forward', 'lanes:bus:forward', 'bus:lanes:backward', 'lanes:bus:backward',
1515
'lanes', 'lanes:forward', 'lanes:backward',
1616
'sidewalk:both', 'sidewalk', 'sidewalk:right', 'sidewalk:left', 'foot',
17-
'routing:bicycle', 'bicycle', 'cycleway:both', 'cycleway:right', 'cycleway:left',
17+
'routing:bicycle', 'bicycle', 'cycleway', 'cycleway:both', 'cycleway:right', 'cycleway:left',
1818
'turn:lanes', 'turn:lanes:forward', 'turn:lanes:backward',
1919
'placement', 'placement:start', 'placement:end', 'width:lanes:start', 'width:lanes:end',
2020
'placement:forward', 'width:lanes:forward:start', 'width:lanes:forward:end',

modules/operations/clone_cycleway.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010

1111
export function operationCloneCycleway(selectedIDs, context) {
1212

13-
const cloneTags = ['routing:bicycle', 'bicycle', 'cycleway:both', 'cycleway:right', 'cycleway:buffer', 'cycleway:marking', 'cycleway:right:marking', 'cycleway:left:marking', 'cycleway:separation', 'cycleway:right:separation', 'cycleway:right:buffer', 'cycleway:right:oneway', 'cycleway:left:separation', 'cycleway:left:buffer', 'cycleway:left:oneway', 'cycleway:left', 'oneway:bicycle', 'lcn']
13+
const cloneTags = ['routing:bicycle', 'bicycle', 'cycleway', 'cycleway:both', 'cycleway:right', 'cycleway:buffer', 'cycleway:marking', 'cycleway:right:marking', 'cycleway:left:marking', 'cycleway:separation', 'cycleway:right:separation', 'cycleway:right:buffer', 'cycleway:right:oneway', 'cycleway:left:separation', 'cycleway:left:buffer', 'cycleway:left:oneway', 'cycleway:left', 'oneway:bicycle', 'lcn'];
1414
var action = actionCloneRoadAttributes(selectedIDs, cloneTags);
1515

1616
var operation = function () {

modules/operations/clone_road_attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function operationCloneRoadAttributes(selectedIDs, context) {
1515
'bus:lanes:forward', 'lanes:bus:forward', 'bus:lanes:backward', 'lanes:bus:backward',
1616
'lanes', 'lanes:forward', 'lanes:backward',
1717
'sidewalk', 'sidewalk:both', 'sidewalk:right', 'sidewalk:left', 'foot',
18-
'routing:bicycle', 'bicycle', 'cycleway:both', 'cycleway:right', 'cycleway:left',
18+
'routing:bicycle', 'bicycle', 'cycleway', 'cycleway:both', 'cycleway:right', 'cycleway:left',
1919
'turn:lanes', 'turn:lanes:forward', 'turn:lanes:backward',
2020
'placement', 'placement:start', 'placement:end', 'width:lanes:start', 'width:lanes:end',
2121
'placement:forward', 'width:lanes:forward:start', 'width:lanes:forward:end',

modules/svg/tag_classes.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ export function svgTagClasses() {
202202
var sidewalkRight = null;
203203
var indoor = null;
204204
var cycleway = null;
205+
var cyclewayLeft = null;
206+
var cyclewayRight = null;
205207
var crossing = null;
206208
var crossingMarkings = null;
207209
var segregated = null;
@@ -271,11 +273,11 @@ export function svgTagClasses() {
271273
classes.push('tag-cycleway-' + cycleway);
272274
}
273275
if (k === 'cycleway:left') {
274-
cycleway = v;
276+
cyclewayLeft = v;
275277
classes.push('tag-cycleway_left-' + cycleway);
276278
}
277279
if (k === 'cycleway:right') {
278-
cycleway = v;
280+
cyclewayRight = v;
279281
classes.push('tag-cycleway_right-' + cycleway);
280282
}
281283
if (k === 'cycleway:both') {
@@ -476,6 +478,15 @@ export function svgTagClasses() {
476478
if (t.highway === 'cycleway' && !segregated) {
477479
classes.push('tag-segregated-undefined');
478480
}
481+
if (cyclewayLeft === 'separate' && cyclewayRight === 'separate') {
482+
classes.push('tag-cycleway-separate');
483+
}
484+
if (cyclewayLeft === 'no' && cyclewayRight === 'separate') {
485+
classes.push('tag-cycleway-separate');
486+
}
487+
if (cyclewayLeft === 'separate' && cyclewayRight === 'no') {
488+
classes.push('tag-cycleway-separate');
489+
}
479490
if (!hasName && (isSidewalk || isCycleway || isCrossing)) {
480491
classes.push('tag-name-no');
481492
}

modules/ui/fields/cycleway.js

+30-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function uiFieldCycleway(field, context) {
3434
.attr('class', 'rows')
3535
.merge(div);
3636

37-
var keys = ['cycleway:both', 'cycleway:left', 'cycleway:right'];
37+
var keys = ['cycleway', 'cycleway:both', 'cycleway:left', 'cycleway:right'];
3838

3939
items = div.selectAll('li')
4040
.data(keys);
@@ -73,28 +73,51 @@ export function uiFieldCycleway(field, context) {
7373

7474

7575
function change() {
76+
var cycleway = utilGetSetValue(d3_select('.preset-input-cycleway'));
7677
var both = utilGetSetValue(d3_select('.preset-input-cyclewayboth'));
7778
var left = utilGetSetValue(d3_select('.preset-input-cyclewayleft'));
7879
var right = utilGetSetValue(d3_select('.preset-input-cyclewayright'));
7980
var tag = {};
8081

81-
if (both === '') { both = undefined; }
82-
if (left === '') { left = undefined; }
83-
if (right === '') { right = undefined; }
82+
// cycleway=separate means in osrm from transition: no access, use sidepath.
83+
// cycleway:both=separate would mean the same
84+
85+
86+
if (cycleway === '' || cycleway === null) { cycleway = undefined; }
87+
if (both === '' || both === null) { both = undefined; }
88+
if (left === '' || left === null) { left = undefined; }
89+
if (right === '' || right === null) { right = undefined; }
8490
if (left !== undefined && right !== undefined && left !== right) {
8591
both = undefined;
92+
if (cycleway !== 'separate') {
93+
cycleway = undefined;
94+
}
8695
}
87-
if (both !== undefined && both !== null) {
88-
left = undefined;
96+
if (both !== undefined) {
97+
left = undefined;
8998
right = undefined;
9099
}
91100
if (left === right && left !== undefined) {
92101
both = left;
102+
if (left === 'separate') {
103+
cycleway = left;
104+
left = undefined;
105+
right = undefined;
106+
both = undefined;
107+
}
108+
}
109+
if (both === 'separate') {
110+
cycleway = 'separate';
111+
both = undefined;
112+
}
113+
if (left === 'separate' && right === 'no' || left === 'no' && right === 'separate') {
114+
cycleway = 'separate';
115+
both = undefined;
93116
}
94117

95118
// Always set both left and right as changing one can affect the other
96119
tag = {
97-
cycleway: undefined,
120+
'cycleway': cycleway,
98121
'cycleway:both': both,
99122
'cycleway:left': left,
100123
'cycleway:right': right

0 commit comments

Comments
 (0)