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

More sophisticated linking with one-way roads #515

Open
ansoncfit opened this issue May 5, 2019 · 2 comments
Open

More sophisticated linking with one-way roads #515

ansoncfit opened this issue May 5, 2019 · 2 comments

Comments

@ansoncfit
Copy link
Member

As of 2e3517b, ways can only be linked to if they are they are traversable in both directions. Relevant in-line commentary (some of which has since been removed):

            // If either direction of the current edge doesn't allow the specified mode of travel, skip it.
            // It is arguably better to skip it only if BOTH directions forbid the specified mode (see commented block
            // below). This system has odd effects in areas with lots of one-way streets or divided roads.
            // TODO Really, we want to allow linking to two different edge-pairs in such cases but that is more complex.
            // Do not consider linking to edges that are not marked "linkable". This excludes e.g. tunnels and motorways.
            if (!edge.allowsStreetMode(streetMode) || !edge.getFlag(EdgeStore.EdgeFlag.LINKABLE)) {
                return true;
            }
            edge.advance();
            if (!edge.allowsStreetMode(streetMode) || !edge.getFlag(EdgeStore.EdgeFlag.LINKABLE)) {
                return true;
            }
            edge.retreat();

            /*
            if (!edge.allowsStreetMode(streetMode)) {
                // The edge does not allow forward traversal with the specified mode, try the backward edge.
                edge.advance();
                // If backward traversal is also not allowed, skip this edge and try the next one.
                if (!edge.allowsStreetMode(streetMode)) return true;
            }
            */

As suggested in the comment, the current implementation leads to "odd effects" in places like Nahant:

image

image

Points along the peninsula will be linked (directly) to the ways at either end of the peninsula, because all (car) ways along the peninsula are one-way.

@abyrd
Copy link
Member

abyrd commented May 5, 2019

Ah maybe I shouldn't have removed the commented out code. I was under the impression the code above it had replaced/improved upon the comment out code. In the future I'll confer before removing anything containing comments.

@ansoncfit
Copy link
Member Author

Another example: origins to the east of Freeport Blvd (https://www.openstreetmap.org/way/899918275#map=16/38.5093/-121.5029) are linked to the side streets west of the one-way pair, which is not what users would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants