mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-25 07:25:47 +03:00
Allow u-turns at merged intersections when the turn lane is explicitly tagged in OSM. This makes the infamous U-turn from Montlake to 520 WB work! The inferred signal timing isn't great, but ah well.
Not regenerating yet
This commit is contained in:
parent
83bc768e28
commit
8ceaf296eb
@ -37,8 +37,19 @@ pub fn make_all_turns(map: &Map, i: &Intersection) -> Vec<Turn> {
|
|||||||
if i.merged {
|
if i.merged {
|
||||||
filtered_turns.retain(|turn| {
|
filtered_turns.retain(|turn| {
|
||||||
if turn.turn_type == TurnType::UTurn {
|
if turn.turn_type == TurnType::UTurn {
|
||||||
warn!("Removing u-turn from merged intersection: {}", turn.id);
|
let src_lane = map.get_l(turn.id.src);
|
||||||
false
|
// U-turns at divided highways are sometimes legal (and a common movement --
|
||||||
|
// https://www.openstreetmap.org/way/361443212), so let OSM turn:lanes override.
|
||||||
|
if src_lane
|
||||||
|
.get_lane_level_turn_restrictions(map.get_r(src_lane.parent), false)
|
||||||
|
.map(|set| !set.contains(&TurnType::UTurn))
|
||||||
|
.unwrap_or(true)
|
||||||
|
{
|
||||||
|
warn!("Removing u-turn from merged intersection: {}", turn.id);
|
||||||
|
false
|
||||||
|
} else {
|
||||||
|
true
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user