Struct map_model::Lane [−][src]
pub struct Lane { pub id: LaneID, pub parent: RoadID, pub lane_type: LaneType, pub lane_center_pts: PolyLine, pub width: Distance, pub dir: Direction, pub src_i: IntersectionID, pub dst_i: IntersectionID, pub bus_stops: BTreeSet<BusStopID>, pub driving_blackhole: bool, pub biking_blackhole: bool, }
A road segment is broken down into individual lanes, which have a LaneType.
Fields
id: LaneID
parent: RoadID
lane_type: LaneType
lane_center_pts: PolyLine
width: Distance
dir: Direction
src_i: IntersectionID
dst_i: IntersectionID
bus_stops: BTreeSet<BusStopID>
Meaningless order
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
impl Lane
[src]
impl Lane
[src]pub fn first_pt(&self) -> Pt2D
[src]
pub fn last_pt(&self) -> Pt2D
[src]
pub fn first_line(&self) -> Line
[src]
pub fn last_line(&self) -> Line
[src]
pub fn endpoint(&self, i: IntersectionID) -> Pt2D
[src]
pub fn end_line(&self, i: IntersectionID) -> Line
[src]
pt2 will be endpoint
pub fn dist_along_of_point(&self, pt: Pt2D) -> Option<Distance>
[src]
pub fn length(&self) -> Distance
[src]
pub fn intersections(&self) -> Vec<IntersectionID>
[src]
pub fn number_parking_spots(&self, cfg: &MapConfig) -> usize
[src]
pub fn is_driving(&self) -> bool
[src]
pub fn is_biking(&self) -> bool
[src]
pub fn is_bus(&self) -> bool
[src]
pub fn is_walkable(&self) -> bool
[src]
pub fn is_sidewalk(&self) -> bool
[src]
pub fn is_shoulder(&self) -> bool
[src]
pub fn is_parking(&self) -> bool
[src]
pub fn is_light_rail(&self) -> bool
[src]
pub fn get_directed_parent(&self) -> DirectedRoadID
[src]
pub fn get_lane_level_turn_restrictions(
&self,
road: &Road,
force_bus: bool
) -> Option<BTreeSet<TurnType>>
[src]
&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.
pub fn trace_around_block(
&self,
map: &Map
) -> Option<(Polygon, BTreeSet<LaneID>)>
[src]
&self,
map: &Map
) -> Option<(Polygon, BTreeSet<LaneID>)>
Starting from this lane, follow the lane’s left edge to the intersection, continuing to “walk around the block” until we reach the starting point. This only makes sense for the outermost lanes on a road. Returns the polygon and all visited lanes.
TODO This process currently fails for some starting positions; orienting is weird.
Trait Implementations
impl<'de> Deserialize<'de> for Lane
[src]
impl<'de> Deserialize<'de> for Lane
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl RefUnwindSafe for Lane
impl Send for Lane
impl Sync for Lane
impl Unpin for Lane
impl UnwindSafe for Lane
Blanket Implementations
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,