Skip to content

Commit

Permalink
highway=motorway_link no longer implies oneway=yes
Browse files Browse the repository at this point in the history
(closes #4727)

iD still explicitly set the tag, and default it to `oneway=yes`
  • Loading branch information
bhousel committed Jan 23, 2018
1 parent de488e2 commit b35f6f3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion data/presets/presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -7214,7 +7214,7 @@
"fields": [
"name",
"ref_road_number",
"oneway_yes",
"oneway",
"maxspeed",
"lanes",
"surface",
Expand Down
8 changes: 6 additions & 2 deletions data/presets/presets/highway/motorway_link.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"fields": [
"name",
"ref_road_number",
"oneway_yes",
"oneway",
"maxspeed",
"lanes",
"surface",
Expand All @@ -25,6 +25,10 @@
"highway": "motorway_link",
"oneway": "yes"
},
"terms": ["ramp", "on ramp", "off ramp"],
"terms": [
"ramp",
"on ramp",
"off ramp"
],
"name": "Motorway Link"
}
3 changes: 1 addition & 2 deletions modules/osm/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ export var osmOneWayTags = {
'yes': true
},
'highway': {
'motorway': true,
'motorway_link': true
'motorway': true
},
'junction': {
'circular': true,
Expand Down
13 changes: 6 additions & 7 deletions test/spec/osm/lanes.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ describe('iD.Lanes', function() {
.to.eql(4);
});

it('returns 1 lane for highway=motorway_link', function() {
it('returns 2 lanes for highway=motorway_link', function() {
expect(iD.Way({tags: { highway: 'motorway_link' }}).lanes().metadata.count, 'motorway_link lanes')
.to.eql(1);
expect(iD.Way({tags: { highway: 'motorway_link', oneway: 'yes' }}).lanes().metadata.count, 'motorway_link lanes')
.to.eql(1);
});

it('returns 2 lanes for highway=motorway_link and oneway=no', function() {
.to.eql(2);
expect(iD.Way({tags: { highway: 'motorway_link', oneway: 'no' }}).lanes().metadata.count, 'motorway_link lanes')
.to.eql(2);
});

it('returns 1 lane for highway=motorway_link and oneway=yes', function() {
expect(iD.Way({tags: { highway: 'motorway_link', oneway: 'yes' }}).lanes().metadata.count, 'motorway_link lanes')
.to.eql(1);
});
});

describe('trunk', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/spec/osm/way.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ describe('iD.osmWay', function() {
expect(iD.Way({tags: { waterway: 'river' }}).isOneWay(), 'river').to.be.true;
expect(iD.Way({tags: { waterway: 'stream' }}).isOneWay(), 'stream').to.be.true;
expect(iD.Way({tags: { highway: 'motorway' }}).isOneWay(), 'motorway').to.be.true;
expect(iD.Way({tags: { highway: 'motorway_link' }}).isOneWay(), 'motorway_link').to.be.true;
expect(iD.Way({tags: { junction: 'roundabout' }}).isOneWay(), 'roundabout').to.be.true;
expect(iD.Way({tags: { junction: 'circular' }}).isOneWay(), 'circular').to.be.true;
});

it('returns false when the way does not have implied oneway tag', function() {
expect(iD.Way({tags: { highway: 'motorway_link' }}).isOneWay(), 'motorway_link').to.be.false;
expect(iD.Way({tags: { highway: 'trunk' }}).isOneWay(), 'trunk').to.be.false;
expect(iD.Way({tags: { highway: 'trunk_link' }}).isOneWay(), 'trunk_link').to.be.false;
expect(iD.Way({tags: { highway: 'primary' }}).isOneWay(), 'primary').to.be.false;
Expand Down

0 comments on commit b35f6f3

Please sign in to comment.