-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 support for multi via-way restrictions #2695
base: master
Are you sure you want to change the base?
Add support for multi via-way restrictions #2695
Conversation
296fe5d
to
73c62b1
Compare
I've added another test to show when this approach does not work:
with the restrictions when turning right from e, we'll be detoured on b'. However, we cannot reach On the other hand, we can not reach SUMMARY The presented approach will fail if a via way of a multi-via-way-restriction is already in use by another via-way-restriction. I tested that this is the case in @easbar we already have the need of multiple artificial edges for overlapping ONLY restrictions. Do you think we should go in this direction or have you any concerns introducing them? |
Thanks for continuing with this. I won't be able to properly review this this year, but will definitely pick up on this afterwards.
I don't think introducing multiple such edges introduces conceptually new problems compared to using just one such edge, so I would not try to avoid this at all costs. However, I'd like to be able to tell whether an edge is an artificial one and which original edge it belongs to. Imagine you wanted to block a certain road after the OSM import. You'd have to know if there is a (or if there are any) artificial duplicates that also need to be blocked. Btw the single via-way restrictions are now live on graphhopper.com/maps and so far I heard no complaints :) |
This is also the case for single via-way restrictions: #2907, and not only for the 'only' restrictions which we already ignore. |
Follow up to #2689:
With the existing approach for single via way restrictions, multi via ways should become quite trivial:
A restriction
a via b via c to d
is modeled as restrictionsa via 1 to b
(so the route must procceed on artificialb'
)b' via 2 to c
(so when being on a artificial edge we can't go back to the original graph) NEWc' via 3 to d
(so we can't reach d when coming from a)using
b
andc
, we can reachd
trough other edges crossing at1
or2
I checked some real life examples from the via way restriction gist which all worked as expected:
1747816, 2063168, 2063172, 2081739, 2896789, 4497772, 4498302
One thing I noticed for only restrictions (e.g. 4498302) is that the route becomes wrong if it ends within a (multi) via way restriction (same as OSRM). If it goes all the way to the end of the restriction it works perfectly fine.