Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actionJoinWays doesn't always reverse the ways while joining #4688

Closed
bhousel opened this issue Jan 13, 2018 · 0 comments
Closed

actionJoinWays doesn't always reverse the ways while joining #4688

bhousel opened this issue Jan 13, 2018 · 0 comments
Labels
bug A bug - let's fix this!

Comments

@bhousel
Copy link
Member

bhousel commented Jan 13, 2018

While working on #4589, I found a tricky bug in actionJoinWays.

This code uses osmJoinWays to get the joined nodelist. Unfortunately osmJoinWays has a side effect that it sometimes needs to reverse the ways in order to join them properly. Reversing a way might change the tags of the way, the order of the nodes, but also adjust the tags on the child nodes.

var joined = osmJoinWays(ways, graph)[0];
survivor = survivor.update({nodes: _map(joined.nodes, 'id')});
graph = graph.replace(survivor);

The reversed ways and nodes never get replaced into the graph, and the code after osmJoinWays continues working with the original immutable survivor way, when really we need to perform those reversal actions.

Here is a case where we join two ways (Left, Right). Both ways have directional stop signs. What should happen is that osmJoinWays should reverse any tags on the Right way and the Right stop sign so that it continues to face East. (osmJoinWays actually does call actionReverse internally, but it doesn't persist the results of that into the graph. It should not update the graph, but it should return those actions so that the caller can do it if needed).

reverse-join-bug

@bhousel bhousel added bug A bug - let's fix this! wip Work in progress labels Jan 13, 2018
bhousel added a commit that referenced this issue Jan 13, 2018
@bhousel bhousel removed the wip Work in progress label Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

No branches or pull requests

1 participant