Skip to content

Commit

Permalink
Don't reverse cardinal direction roles on relations anymore
Browse files Browse the repository at this point in the history
re: #2004 (comment)

Per thread https://twitter.com/bhousel/status/1025805098063208448
JOSM has stopped doing this too
  • Loading branch information
bhousel committed Aug 5, 2018
1 parent 490d4d3 commit 2e6799a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
6 changes: 1 addition & 5 deletions modules/actions/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ export function actionReverse(wayID, options) {
forward: 'backward',
backward: 'forward',
forwards: 'backward',
backwards: 'forward',
north: 'south',
south: 'north',
east: 'west',
west: 'east'
backwards: 'forward'
};
var onewayReplacements = {
yes: '-1',
Expand Down
12 changes: 6 additions & 6 deletions test/spec/actions/reverse.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ describe('iD.actionReverse', function () {
.entity('backwards').members[0].role).to.eql('forward', 'backwards');
});

it('transforms role=north ⟺ role=south in member relations', function () {
it('doesn\'t transform role=north ⟺ role=south in member relations', function () {
var graph = iD.coreGraph([
iD.osmNode({id: 'n1'}),
iD.osmNode({id: 'n2'}),
Expand All @@ -296,12 +296,12 @@ describe('iD.actionReverse', function () {
]);

expect(iD.actionReverse('w1')(graph)
.entity('north').members[0].role).to.eql('south', 'north');
.entity('north').members[0].role).to.eql('north', 'north');
expect(iD.actionReverse('w1')(graph)
.entity('south').members[0].role).to.eql('north', 'south');
.entity('south').members[0].role).to.eql('south', 'south');
});

it('transforms role=east ⟺ role=west in member relations', function () {
it('doesn\'t transform role=east ⟺ role=west in member relations', function () {
var graph = iD.coreGraph([
iD.osmNode({id: 'n1'}),
iD.osmNode({id: 'n2'}),
Expand All @@ -311,9 +311,9 @@ describe('iD.actionReverse', function () {
]);

expect(iD.actionReverse('w1')(graph)
.entity('east').members[0].role).to.eql('west', 'east');
.entity('east').members[0].role).to.eql('east', 'east');
expect(iD.actionReverse('w1')(graph)
.entity('west').members[0].role).to.eql('east', 'west');
.entity('west').members[0].role).to.eql('west', 'west');
});

it('ignores directionless roles in member relations', function () {
Expand Down

0 comments on commit 2e6799a

Please sign in to comment.