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

Add ways from highway relations to road network #2807

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

easbar
Copy link
Member

@easbar easbar commented Apr 26, 2023

Currently there are around 53k relations tagged as highway=*. Many (~18k, c.f. #2805) of them carry the area=yes tag, but even without considering that they might represent (routeable) areas, it seems useful to allow routing along the corresponding member ways.

In this PR I added a third (0th) pass for reading the OSM file to create a list of these relations, which is then used to create the corresponding edges in pass1/2. Relation member ways inherit the tags from their parent relation, but they are only considered if they would not have been accepted based on their (way) tags already.

This screenshot shows highway relations in Paris with (blue) and without (red) an area=yes tag:

image

where highway relations are often used to map sidewalks:

image

Adding them allows routing along the sidewalk of course:

before after
image image

An important catch here is that we should exclude the 'inner' polygons of the highway relations, because sometimes they are connected to the outer polygons and/or the remaining road network only at one or a few points. This means that when we snap onto the inner polygon we might calculate a route with a long detour that goes to these connecting points and back like this:

image

This problem is not completely new, though and exists already in master (for normal highways with a similar shape), like here:

image

To fix this we would probably either need to add artificial extra edges as in #2805 and/or extend our greedy snapping algorithm.

Comment on lines +92 to +94
if (ignoredHighways.contains("pedestrian") && ignoredHighways.contains("footway"))
// if are both ignored we can skip pass0 altogether
return null;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0th pass is skipped entirely if pedestrian and footway are both added to the list of ignored highways, because >80% of these highway relations use one of these two highway values. Then again, there are also around 10k relations tagged as service,tertiary,platform,bus_stop.... I'm not sure if we really need them for motorized-only routing (i.e. when pedestrian+footway are excluded). In case they are not excluded we would accept all highway relations anyway with this PR.

@easbar easbar temporarily deployed to benchmarks April 26, 2023 20:55 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant