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: IntersectionIDpolygon: Polygon

This needs to be in clockwise orientation, or later rendering of sidewalk corners breaks.

turns: Vec<Turn>elevation: Distanceintersection_type: IntersectionTypeorig_id: NodeIDincoming_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

Does this intersection only connect two road segments? Then usually, the intersection only exists to mark the road name or lanes changing.

Does this intersection connect to only a single driveable road segment?

Ignoring mode of travel, is this intersection only connected to one road?

Strict for bikes. If there are bike lanes, not allowed to use other lanes.

Higher numbers get drawn on top

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).

Don’t call for SharedSidewalkCorners

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.