Struct map_model::Intersection
source · pub struct Intersection {Show 13 fields
pub id: IntersectionID,
pub polygon: Polygon,
pub turns: Vec<Turn>,
pub elevation: Distance,
pub kind: IntersectionKind,
pub control: IntersectionControl,
pub orig_id: NodeID,
pub incoming_lanes: Vec<LaneID>,
pub outgoing_lanes: Vec<LaneID>,
pub roads: Vec<RoadID>,
pub modal_filter: Option<DiagonalFilter>,
pub merged: bool,
pub movements: BTreeMap<MovementID, Movement>,
}
Expand description
An intersection connects roads. Most have >2 roads and are controlled by stop signs or traffic signals. Roads that lead to the boundary of the map end at border intersections, with only that one road attached.
Fields§
§id: IntersectionID
§polygon: Polygon
This needs to be in clockwise orientation, or later rendering of sidewalk corners breaks.
turns: Vec<Turn>
§elevation: Distance
§kind: IntersectionKind
§control: IntersectionControl
§orig_id: NodeID
§incoming_lanes: Vec<LaneID>
Note that a lane may belong to both incoming_lanes and outgoing_lanes.
outgoing_lanes: Vec<LaneID>
§roads: Vec<RoadID>
§modal_filter: Option<DiagonalFilter>
§merged: bool
Was a short road adjacent to this intersection merged?
movements: BTreeMap<MovementID, Movement>
Implementations§
source§impl Intersection
impl Intersection
pub fn is_border(&self) -> bool
pub fn is_incoming_border(&self) -> bool
pub fn is_outgoing_border(&self) -> bool
pub fn is_closed(&self) -> bool
pub fn is_stop_sign(&self) -> bool
pub fn is_traffic_signal(&self) -> bool
pub fn is_light_rail(&self, map: &Map) -> bool
pub fn is_private(&self, map: &Map) -> bool
pub fn is_footway(&self, map: &Map) -> bool
pub fn is_cycleway(&self, map: &Map) -> bool
sourcepub fn is_degenerate(&self) -> bool
pub fn is_degenerate(&self) -> bool
Does this intersection only connect two road segments? Then usually, the intersection only exists to mark the road name or lanes changing.
sourcepub fn is_deadend_for_driving(&self, map: &Map) -> bool
pub fn is_deadend_for_driving(&self, map: &Map) -> bool
Does this intersection connect to only a single driveable road segment?
sourcepub fn is_deadend_for_everyone(&self) -> bool
pub fn is_deadend_for_everyone(&self) -> bool
Ignoring mode of travel, is this intersection only connected to one road?
pub fn get_incoming_lanes( &self, map: &Map, constraints: PathConstraints ) -> Vec<LaneID>
sourcepub fn get_outgoing_lanes(
&self,
map: &Map,
constraints: PathConstraints
) -> Vec<LaneID>
pub fn get_outgoing_lanes( &self, map: &Map, constraints: PathConstraints ) -> Vec<LaneID>
Strict for bikes. If there are bike lanes, not allowed to use other lanes.
sourcepub fn get_zorder(&self, map: &Map) -> isize
pub fn get_zorder(&self, map: &Map) -> isize
Higher numbers get drawn on top
pub fn get_rank(&self, map: &Map) -> RoadRank
pub fn get_road_sides_sorted(&self, map: &Map) -> Vec<RoadSideID>
sourcepub fn get_sorted_incoming_roads(&self, map: &Map) -> Vec<RoadID>
pub fn get_sorted_incoming_roads(&self, map: &Map) -> Vec<RoadID>
Return all incoming roads to an intersection, sorted by angle. This skips one-way roads outbound from the intersection, since no turns originate from those anyway. This allows heuristics for a 3-way intersection to not care if one of the roads happens to be a dual carriageway (split into two one-ways).
pub fn some_outgoing_road(&self, map: &Map) -> Option<DirectedRoadID>
pub fn some_incoming_road(&self, map: &Map) -> Option<DirectedRoadID>
pub fn name(&self, lang: Option<&String>, map: &Map) -> String
sourcepub fn turn_to_movement(
&self,
turn: TurnID
) -> (MovementID, CompressedMovementID)
pub fn turn_to_movement( &self, turn: TurnID ) -> (MovementID, CompressedMovementID)
Don’t call for SharedSidewalkCorners
pub fn find_road_between<'a>( &self, other: IntersectionID, map: &'a Map ) -> Option<&'a Road>
Trait Implementations§
source§impl Clone for Intersection
impl Clone for Intersection
source§fn clone(&self) -> Intersection
fn clone(&self) -> Intersection
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more