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

Line direction is reverted at merge #4872

Closed
yaugenka opened this issue Mar 11, 2018 · 6 comments
Closed

Line direction is reverted at merge #4872

yaugenka opened this issue Mar 11, 2018 · 6 comments
Labels
bug A bug - let's fix this!

Comments

@yaugenka
Copy link

When you merge two lines the direction is reverted but only if you select the last line first.
linemerge

@bhousel
Copy link
Member

bhousel commented Mar 14, 2018

Ah yeah, iD strongly prefers to generate a forward path..

The same code that joins ways also joins relation members. This comment is right before the part that does the reversal.

// Strongly prefer to generate a forward path that preserves the order
// of the members array. For multipolygons and most relations, member
// order does not matter - but for routes, it does. If we started this
// sequence backwards (i.e. next member way attaches to the start node
// and not the end node), reverse the initial way before continuing.

I'm going to close here, since it doesn't really affect anything..

@bhousel bhousel closed this as completed Mar 14, 2018
@yaugenka
Copy link
Author

@bhousel It seems there is something wrong there. The direction matters for waterways and one-way highways. Waterways can be very wandering and you can easily lose track of what direction the current segment is supposed to have. It has already occurred to me to save such incorrect reverting, but I was lucky to notice the mistake later on. With one-way highways such mistakes are especially dangerous due to usage in navigation.

@bhousel
Copy link
Member

bhousel commented Mar 14, 2018

@bhousel It seems there is something wrong there. The direction matters for waterways and one-way highways. Waterways can be very wandering and you can easily lose track of what direction the current segment is supposed to have. It has already occurred to me to save such incorrect reverting, but I was lucky to notice the mistake later on. With one-way highways such mistakes are especially dangerous due to usage in navigation.

Ok, I just tested this - the reversing doesn't actually affect oneway roads (the tag gets reversed to oneway=-1), but it does affect waterways.

I'll see if this is something we can fix. The main issue is if those ways also belong to a relation that requires the members ordered in a forward direction. Maybe I can skip that reversal code in most cases.

@bhousel bhousel reopened this Mar 14, 2018
@bhousel bhousel added the bug A bug - let's fix this! label Mar 14, 2018
@yaugenka
Copy link
Author

yaugenka commented Mar 14, 2018

the reversing doesn't actually affect oneway roads (the tag gets reversed to oneway=-1)

Ok, the tag secures the navigation. But is it really correct to revert the line direction and then fix it by means of the tag in this case? Let's take for example this one-way highway which is part of a route
https://www.openstreetmap.org/edit?way=314718034#map=17/52.96646/29.87338
The direction of this way is correct and coincides with the direction of the proceeding and following ways.
If you cut this way and merge it back, its direction will be reverted and the oneway tag will get changed from 'yes' to '-1', whereas the proceeding and the following ways will reserve their initial correct direction.

@bhousel
Copy link
Member

bhousel commented Apr 19, 2018

I'll see if this is something we can fix. The main issue is if those ways also belong to a relation that requires the members ordered in a forward direction. Maybe I can skip that reversal code in most cases.

☝️ I did this - now iD won't reverse the ways when it doesn't need to..

@yaugenka
Copy link
Author

Thanks, @bhousel !

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

2 participants