Struct map_model::objects::intersection::Intersection
source · [−]pub struct Intersection {
pub id: IntersectionID,
pub polygon: Polygon,
pub turns: Vec<Turn>,
pub elevation: Distance,
pub intersection_type: IntersectionType,
pub orig_id: NodeID,
pub incoming_lanes: Vec<LaneID>,
pub outgoing_lanes: Vec<LaneID>,
pub roads: BTreeSet<RoadID>,
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
intersection_type: IntersectionType
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: BTreeSet<RoadID>
merged: bool
Was a short road adjacent to this intersection merged?
movements: BTreeMap<MovementID, Movement>
Implementations
sourceimpl 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>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn get_outgoing_lanes(
&self,
map: &Map,
constraints: PathConstraints
) -> Vec<LaneID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_outgoing_lanes(
&self,
map: &Map,
constraints: PathConstraints
) -> Vec<LaneID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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_roads_sorted_by_incoming_angle(&self, map: &Map) -> Vec<RoadID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn get_road_sides_sorted_by_incoming_angle(
&self,
map: &Map
) -> Vec<RoadSideID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourcepub fn get_sorted_incoming_roads(&self, map: &Map) -> Vec<RoadID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_sorted_incoming_roads(&self, map: &Map) -> Vec<RoadID>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
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
sourceimpl Clone for Intersection
impl Clone for Intersection
sourcefn clone(&self) -> Intersection
fn clone(&self) -> Intersection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Intersection
impl Debug for Intersection
sourceimpl<'de> Deserialize<'de> for Intersection
impl<'de> Deserialize<'de> for Intersection
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for Intersection
impl Serialize for Intersection
Auto Trait Implementations
impl RefUnwindSafe for Intersection
impl Send for Intersection
impl Sync for Intersection
impl Unpin for Intersection
impl UnwindSafe for Intersection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more