-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Support for conditional restriction and/or speed limits #3414
Comments
To clarify here: we don't strictly have to implement this in osrm-backend. It could be a little executable reading a pbf file and generating two csv files for every 5 minutes: one file for speed updates, one file for turn penalty updates. We then can use these csv files in combination with the Traffic feature. Check the format here: |
We also have to convert the local time in OSM tags to UTC. For this I used http://efele.net/maps/tz/world/
before. It's all quite hacky but should work .. I think internally we might have timezone handling already, maybe ping @danpat in chat. |
@oxidase This is great. Let me sketch out how I think we could use this so that people could support conditional restrictions. The basic approach would be:
The limitations are:
We could have a tool, say,
Let's assume for now that these buckets are CSV files in some directory structure. Once the above is complete, we can then do:
Other aspects
I think the next step is to look at the |
After tooling around with the
Having the tool as part of the osrm-extract step reuses the existing access to Lua profiles for access tag configuration. It also makes keeping the time windows in sync with the extracted data easier and more relevant. Processing more time in advance (like a year) would mean that we miss additional restrictions and would have to account for seasonal time changes and leap year offsets. This will add a few more iterations (i.e. processing time) over extracted objects because restrictions will need to be parsed out of ways and nodes in addition to relations. To start it will be simplest to only support cc @oxidase |
@karenzshea the approach looks good to me, Saving conditional restrictions in One thing that i would like to add.
and update edge weights/durations from the |
Integration into Since that would mean we introduce code to check if restrictions apply in the hot code path of time dependent updates it needs to be fast. So I would prefer if the representation of time ranges would be basically integer range checks and normalize to UTC+0. Storing whole strings like "Mo-Fr 07:00-18:00" will add a lot of lookup time. If we normalize this into distinct filter ranges: Month, Weekday, Hour we can represent every (sensible) restriction as integer ranges: (1-12) (Month) (1-7) (Weekday) (0-24) (Hour) as we all know from how dates are represented. Mo-Fr 07:00-18:00 would become: Month: 1-12 Weekday: 1-5 Hour: 7-18. In
However (3) might become slow depending on the number of restricted turns. If a linear scan is too expensive we should switch to implement a Segment Tree for each month, weekday and hours. That way you could get a list of all turn edges by doing three segment tree queries and intersecting the resulting lists. |
@TheMarex points 1,2,4 are already implemented in For point 3, almost all time conditions are periodic and some conditions can be stacked and combined, like on some weekdays but not on some specific dates. So only a bounded time range for pre-generated intervals can be used. I am for the linear lookup as the first implementation, and when use-cases will be well-defined make an interval tree implementation if it will be needed. |
Closed via #3841 |
To handle conditional tags like restriction:conditional support for opening hours must be added into osrm-extract/osrm-contract
Tasks:
/cc @daniel-j-h
The text was updated successfully, but these errors were encountered: