DennisOSRM/Project-OSRM — Issue #77: prioritize certain ways depending on tags - separately from speed
Author: emiltin
Created: 2012-01-14 13:50:40+00:00
State: open

i think it will be imporant to be able to set 'attractiveness' on ways depending on certain tags.

this should be separate from the speed, since it's still important to have the correct speeds for each sections, so that a estimated travel time can be computed.

for example, we want to prioritize streets with bike tracks over streets without, even though the speed might be the same, or slightly lower. the same goes for green routes, which people often prefer over a big road, even though the speed might be similar or lower.

one way it could be done simply is by hardcoding the tag combinations in osrm, but allowing the weight to be set in the speedprofile. something like:

if(accesTag=='bicycle' && cycleway=='track')
attractiveness = w.keyVals.Find("bike_track_attractiveness"); //value set in speedprofile, say 1.4
else if(accesTag=='bicycle' && cycleway=='lane')
attractiveness = w.keyVals.Find("bike_lane_attractiveness"); //value set in speedprofile, say 1.2
else if(accesTag=='bicycle' && route != nil)
attractiveness = w.keyVals.Find("bike_route_attractiveness"); //value set in speedprofile, say 1.5
//other cases goes here....
else
attractiveness = 1.0;