Project-OSRM / osrm-backend

Open Source Routing Machine - C++ backend
http://map.project-osrm.org
BSD 2-Clause "Simplified" License
6.34k stars 3.36k forks source link

Multiple routing profile in one data file #2791

Closed homersimpsons closed 8 years ago

homersimpsons commented 8 years ago

Hello,

There is a request https://github.com/mapsme/omim/issues/1888 in maps.me to add an option to avoid toll. But as it's a smartphone software, they care about map size. Then they can't add this profile.

Is it possible to extend routing data configuration to support multiple routing. This is to avoid one routing data per profile.

I know that this is not the base idea (which was we 'basicaly' search for lowest penalty between two nodes to get the fastest route for this profile) maybe data file can describe more profile just by supporting boolean value (here is it for toll, but it could be heigh preference or to avoid trunk). The different profile should be penalty compatible but can get roads restrictions.

danpat commented 8 years ago

@homersimpsons Because of the Contraction Hierarchy graph structure that OSRM uses, it is non-trivial to support query-time options like "avoid tolls" or "avoid ferries".

For a more detailed discussion, see: https://github.com/Project-OSRM/osrm-backend/issues/2377

frodrigo commented 8 years ago

Also look at #10

homersimpsons commented 8 years ago

First of all, in profile you need to include different condition to take care (boolean toll, float height, float weight etc.) This condition can be evaluated and only return a boolean.

homersimpsons commented 8 years ago

For toll road, we can consider that a road is paid or not, then maybe is it possible to consider paid road as a subgraph. Then do two different Contraction for paid road and free ones

daniel-j-h commented 8 years ago

Closing here as duplicate of the issues linked above. CH does not support dynamic query time flags e.g. for tolls, ferries and so on. What you can do is create multiple profiles run OSRM on each of them. This will create multiple .osrm. datasets. Feel free to zip them up and ship them.

danpat commented 8 years ago

@daniel-j-h In theory we could create a second overlay graph for different profiles, as much of the underlying data would be common. It would basically require an additional .hsgr file per profile, which is quite large, but https://github.com/Project-OSRM/osrm-backend/issues/10 is the container ticket for that.