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

Bike and walk speed options #364

Open
langbein-daniel opened this issue Jul 12, 2023 · 3 comments
Open

Bike and walk speed options #364

langbein-daniel opened this issue Jul 12, 2023 · 3 comments

Comments

@langbein-daniel
Copy link

As far as I can tell, there is no bike or walk speed option for the intermodal routing API (https://motis-project.de/docs/api/endpoint/intermodal.html). Is this already planned or are you first focusing on different improvements like accessible walk navigation with the Per Pedes Routing project?

@felixguendling
Copy link
Member

felixguendling commented Jul 12, 2023

Short version: currently this is configurable via profiles for the preprocessing of PPR/OSRM. It's possible to make multiple OSRM profiles selectable (as is already the case for PPR). The next MOTIS version includes valhalla which can handle profiles in the API.

Long: MOTIS uses different routers, all have configurable speeds:

For speed reasons (EDIT: computation speedup), those two routers use preconfigured profiles. The routing query can select one of those preconfigured profiles. With Per Pedes Routing (PPR) you can select a profile explicitely, with OSRM we could add this feature if needed (currently, only Foot/Bike/Car profiles are hardcoded but can be configured based on the lua file configured in the MOTIS config.ini).

The next MOTIS release (coming in the next few days) will include the valhalla router which is more flexible regarding profiles. Valhalla can handle those parameters via the request (where OSRM requires them already during the preprocessing). Currently, MOTIS does not forward any parameters. But this is not a real technical limitation from the router but rather a few lines of code to pass through the profile.

@PartTimeDataScientist
Copy link

Will it be possible to run a dual configuration, i.e. do the Matrix routing with OSRM and the "fine routing" with Valhalla or do you expect the matrix routing of Valhalla to be fast enough for the MOTIS use case although it is considerably slower than that of OSRM (valhalla/valhalla#2604)

@felixguendling
Copy link
Member

Since we're using our own version of OSRM which is optimized for our use case, the difference between Valhalla and OSRM in MOTIS for the door-to-door routing is even bigger than the statistics from your link.

But currently, we're only using the default table routing algorithm in Valhalla which is not specialized to our use case. The table routing is N sources to M targets and we only need 1 to N ("1:N") and N to 1 ("N:1"). Additionally the "N" in 1:N and N:1 are always roughly in a circle of x minutes around the "1" in 1:N and N:1. This means that probably the best algorithm for this task available in Valhalla is probably not the table routing or (bidirectional) A* but just the simple Dijkstra's algorithm which has exactly those properties: it searches in all directions (no goal direction, no fancy tricks). So my idea is that it might be possible to adapt the existing Dijkstra implementation in Valhalla to give us the shortest paths for the N:1 and 1:N problem we have in MOTIS.

The goal for the v0.11.0 release was to land Valhalla in MOTIS without any MOTIS-specific optimizations. I could even imagine that simply fine-tuning the request we assemble for Valhalla could make it faster. So now the next step is to figure out how to optimize it for our use case of computing shortest paths to/from surrounding public transport stops.

If you have OSRM anyway, I would use it for everything except if there are very specific things you can only do with Valhalla. Currently, Valhalla fakes to be OSRM in MOTIS (regarding the API routes), so at the moment dual configuration doesn't work. But if someone would need this, it would be a small change.

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

No branches or pull requests

3 participants