Add ways from highway relations to road network #2807
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently there are around 53k relations tagged as
highway=*
. Many (~18k, c.f. #2805) of them carry thearea=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:where highway relations are often used to map sidewalks:
Adding them allows routing along the sidewalk of course:
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:
This problem is not completely new, though and exists already in master (for normal highways with a similar shape), like here:
To fix this we would probably either need to add artificial extra edges as in #2805 and/or extend our greedy snapping algorithm.