pub struct Building {Show 13 fields
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,
}
Expand description
A building has connections to the road and sidewalk, may contain commercial amenities, and have off-street parking.
Fields
id: BuildingID
polygon: Polygon
levels: f64
address: String
name: Option<NamePerLanguage>
orig_id: OsmID
label_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: BuildingType
parking: OffstreetParking
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
sourceimpl Building
impl Building
pub fn sidewalk(&self) -> LaneID
pub fn house_number(&self) -> Option<String>
sourcepub fn driving_connection(&self, map: &Map) -> Option<(Position, PolyLine)>
pub fn driving_connection(&self, map: &Map) -> Option<(Position, PolyLine)>
The polyline goes from the building to the driving position
sourcepub fn biking_connection(&self, map: &Map) -> Option<(Position, Position)>
pub fn biking_connection(&self, map: &Map) -> Option<(Position, Position)>
Returns (biking position, sidewalk position). Could fail if the biking graph is disconnected.
pub fn num_parking_spots(&self) -> usize
sourcepub fn has_amenity(&self, category: AmenityType) -> bool
pub fn has_amenity(&self, category: AmenityType) -> bool
Does this building contain any amenity matching the category?
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Building
impl<'de> Deserialize<'de> for Building
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
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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>
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more