pub struct Lane {
pub id: LaneID,
pub lane_type: LaneType,
pub lane_center_pts: PolyLine,
pub width: Distance,
pub dir: Direction,
pub src_i: IntersectionID,
pub dst_i: IntersectionID,
pub driving_blackhole: bool,
pub biking_blackhole: bool,
}
Expand description
A road segment is broken down into individual lanes, which have a LaneType.
Fields§
§id: LaneID
§lane_type: LaneType
§lane_center_pts: PolyLine
§width: Distance
§dir: Direction
§src_i: IntersectionID
§dst_i: IntersectionID
§driving_blackhole: bool
{Cars, bikes} trying to start or end here might not be able to reach most lanes in the graph, because this is near a border.
biking_blackhole: bool
Implementations§
source§impl Lane
impl Lane
pub fn first_pt(&self) -> Pt2D
pub fn last_pt(&self) -> Pt2D
pub fn first_line(&self) -> Line
pub fn last_line(&self) -> Line
pub fn endpoint(&self, i: IntersectionID) -> Pt2D
sourcepub fn end_line(&self, i: IntersectionID) -> Line
pub fn end_line(&self, i: IntersectionID) -> Line
pt2 will be endpoint
pub fn dist_along_of_point(&self, pt: Pt2D) -> Option<Distance>
pub fn length(&self) -> Distance
pub fn intersections(&self) -> Vec<IntersectionID>
pub fn number_parking_spots(&self, cfg: &MapConfig) -> usize
pub fn is_driving(&self) -> bool
pub fn is_biking(&self) -> bool
pub fn is_bus(&self) -> bool
pub fn is_walkable(&self) -> bool
pub fn is_sidewalk(&self) -> bool
pub fn is_shoulder(&self) -> bool
pub fn is_parking(&self) -> bool
pub fn is_light_rail(&self) -> bool
pub fn is_footway(&self) -> bool
pub fn get_directed_parent(&self) -> DirectedRoadID
sourcepub fn get_nearest_side_of_road(&self, map: &Map) -> RoadSideID
pub fn get_nearest_side_of_road(&self, map: &Map) -> RoadSideID
This does the reasonable thing for the leftmost and rightmost lane on a road – except for roads with exactly one lane. For lanes in the middle of a road, it uses the direction of the lane – so bidirectional/contraflow cycletracks will produce weird results.
sourcepub fn get_lane_level_turn_restrictions(
&self,
road: &Road,
force_bus: bool
) -> Option<BTreeSet<TurnType>>
pub fn get_lane_level_turn_restrictions( &self, road: &Road, force_bus: bool ) -> Option<BTreeSet<TurnType>>
Returns the set of allowed turn types, based on individual turn lane restrictions. None
means all turn types are allowed.
This will return None
for bus lanes, unless force_bus
is true. OSM turn restrictions on
bus lanes usually apply to regular vehicles, not the buses. When generating the turns for
buses, we probably don’t want to use the restrictions.