Project-OSRM / osrm-backend

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

Ignore intermittent or stop-and-go traffic signals #4212

Open 1ec5 opened 7 years ago

1ec5 commented 7 years ago

The car profile treats any node tagged with highway=traffic_signals as a traffic light, presumably eligible for a penalty. However, not every highway=traffic_signals node would cause a car to stop for a significant amount of time. The auxiliary traffic_signals=* key provides a bit more nuance:

taginfo says Valhalla supports this tag. Additionally, iD’s traffic light preset offers a combo box based on the most common values for the traffic_signals key.

/ref #3747 /cc @danpat

willwhite commented 7 years ago

What impact does this have or what is the buggy behavior that you're seeing here?

1ec5 commented 7 years ago

In general terms, the impact is that OSRM is penalizing for things that should carry no penalty. For example, OSRM currently incorrectly penalizes many freeway on-ramps in California due to the presence of traffic_signals=ramp_meter. However, I haven’t done any measurements to determine how big of a problem this is in practice.

1ec5 commented 7 years ago

I’d imagine the fix would be pretty simple: modify this line in the profile to avoid setting result.traffic_lights if traffic_signals is set to any value other than signals.

1ec5 commented 6 years ago

A fix for this issue would complement the stop sign improvements in #2652.

/cc @chaupow

emiltin commented 6 years ago

It's a good idea to handle this, however i think a bigger improvement would be gained by avoiding double penalties at intersections, where multiple nodes are tagged with traffic_signal, but they change together so really should only incur the delay once. See #1250.

1ec5 commented 6 years ago

I think most of the tags above would affect different roads than the ones affected by #1250 – such as freeway ramps for traffic_signals=ramp_meter – but I agree that both changes would be a significant improvement.

ZLima12 commented 3 years ago

It's worth noting that traffic_signals=blinker does not necessarily mean that it's blinking red; if it blinks red, it acts as a stop sign, but if it blinks yellow, it acts as a yield sign (highway=give_way).