Project-OSRM / osrm-backend

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

Penalties for urban routing vs non-urban or through-roads #1414

Closed Skippern closed 8 years ago

Skippern commented 9 years ago

I am trying to sort out why routing is pulled through Vila Velha and Vitoria instead of following BR-101 (see 1 and 2). Both alternatives have maxspeed set, as well as surface, most turn restrictions should be in place, toll stations (both alternatives are toll roads), but I see that still are missing traffic signals, pedestrian crossings, stop signs to some extents on both alternatives. This will mainly result in extended time for the urban option (which should not be desired for through traffic). After asking on irc channel osrm and tried to interpret the car.lua profile, I see that traffic signals are penalised by 2 (seconds?) while none of the other tags that might impact routing in an urban situation, such as pedestrian crossings, stop signs, give way signs are penalised.

frodrigo commented 9 years ago

Since all traffic light, stop... are not mapped, present and not present object need to be take into account with an average. It's not simply take OSM mapped object.

Skippern commented 9 years ago

@frodrigo At the moment many of these objects are not penalised in the routing, in the case above, the difference in distance is proximately 2km (urban is shorter) and 5 minutes (urban is faster). This is not true because of a lot of traffic signals, pedestrian crossings, give way intersections, etc.

To not penalise traffic signs just because not all of them is mapped is not going to help. A penalty on these objects can make it more interesting to map them, and when a sufficient amount of these objects are mapped avoid routing alternatives such as the ones described in this issue.

emiltin commented 9 years ago

related to #1250, #1317

TheMarex commented 9 years ago

The problem is that you most likely will not hit all red-rights when you go down a street. 2 seconds is just any value to make it slightly slower to use roads with lots of traffic signals. You don't want to set this value too hight, or you will get strange results in cities: Cars are taken off major roads and routed through pedestrian areas to skip a few traffic signals. You could try to balance this with a turn penalty function. If you have some time on your hands you could use a local extract and play a little bit with the car profile and different values for traffic signal penalty and turn costs (the function is currently commented out).

Skippern commented 9 years ago

I currently lack time and a computer with sufficient disk space and power to run an instance of OSRM, I am hoping to get access to a server for an instance, but have nothing in sight at the moment. I see turn penalties are coming up, that might partially help, but still at least other features that might penalise (traffic_calming, stop signs, pedestrian crossings, etc) might also be a good help

emiltin commented 9 years ago

Another approach would be use penalize/prioritize ways that are inside or close to certain areas or elements, like landuse=* or natural=*. For example routing inside landuse=residential might incur a penalty.

We use this on www.ibikecph.dk to compute 'green routes' that follow parks, lakes, green areas, etc. when possible. We query PostGIS from the lua profile to achieve this. It would be interesting if osrm could support these type of use cases without needing PostGIS.

Skippern commented 9 years ago

@emiltin An interesting approach, maybe a 1% or 2% reduction of speed ''due to the fact that there might be a lot of pedestrians along the itinerary''.

daniel-j-h commented 8 years ago

Work on this started in https://github.com/Project-OSRM/osrm-backend/pull/3009 - Road Priorities: Stop Signs, Give Ways, Priority Roads. More traffic calming features based on node tags is ticketed over at https://github.com/Project-OSRM/osrm-backend/issues/3021. I'm closing this here.