Struct map_model::objects::building::Building[][src]

pub struct Building {
    pub id: BuildingID,
    pub polygon: Polygon,
    pub levels: f64,
    pub address: String,
    pub name: Option<NamePerLanguage>,
    pub orig_id: OsmID,
    pub label_center: Pt2D,
    pub amenities: Vec<Amenity>,
    pub bldg_type: BuildingType,
    pub parking: OffstreetParking,
    pub osm_tags: Tags,
    pub sidewalk_pos: Position,
    pub driveway_geom: PolyLine,
}

A building has connections to the road and sidewalk, may contain commercial amenities, and have off-street parking.

Fields

id: BuildingIDpolygon: Polygonlevels: f64address: Stringname: Option<NamePerLanguage>orig_id: OsmIDlabel_center: Pt2D

Where a text label should be centered to have the best chances of being contained within the polygon.

amenities: Vec<Amenity>bldg_type: BuildingTypeparking: OffstreetParkingosm_tags: Tags

Depending on options while importing, these might be empty, to save file space.

sidewalk_pos: Position

The building’s connection for any agent can change based on map edits. Just store the one for pedestrians and lazily calculate the others.

driveway_geom: PolyLine

Goes from building to sidewalk

Implementations

impl Building[src]

pub fn sidewalk(&self) -> LaneID[src]

pub fn house_number(&self) -> Option<String>[src]

pub fn driving_connection(&self, map: &Map) -> Option<(Position, PolyLine)>[src]

The polyline goes from the building to the driving position

pub fn biking_connection(&self, map: &Map) -> Option<(Position, Position)>[src]

Returns (biking position, sidewalk position). Could fail if the biking graph is disconnected.

pub fn num_parking_spots(&self) -> usize[src]

pub fn has_amenity(&self, category: AmenityType) -> bool[src]

Does this building contain any amenity matching the category?

Trait Implementations

impl Debug for Building[src]

impl<'de> Deserialize<'de> for Building[src]

impl Serialize for Building[src]

Auto Trait Implementations

impl RefUnwindSafe for Building

impl Send for Building

impl Sync for Building

impl Unpin for Building

impl UnwindSafe for Building

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,