pub enum Area {}
Expand description
An area, as the name suggests, is some mapped area with tags.
§Way or Relation?
An “area” is actually not a type of object defined by osm. It is more like a meta object. In osm an “area” is ether a single way or a relation of ways with appropriated tags.
Use is_from_way
to check what a given area is actually saved as
and original_id
to get the underlying object’s is.
§Multipolygon
A multipolygon consists of multiple polygons named “outer rings” which contain “inner rings”.
These are polygons as well, which are “cut out” from their outer ring.
Use outer_rings
and inner_rings
to access the area’s rings.
Each ring i.e. polygon is just a list of points.
While the general shape of an area is a multipolygon, most areas are just a single outer ring without any inner ones.
For example most residential buildings are just a single polygon.
Use is_multipolygon
and num_rings
to check an area’s shape.
Implementations§
Source§impl Area
impl Area
Sourcepub fn is_from_way(&self) -> bool
pub fn is_from_way(&self) -> bool
Was this area created from a way? (In contrast to areas created from a relation and their members.)
Sourcepub fn original_id(&self) -> i64
pub fn original_id(&self) -> i64
Return the Id of the way or relation this area was created from.
Sourcepub fn num_rings(&self) -> (usize, usize)
pub fn num_rings(&self) -> (usize, usize)
Count the number of outer and inner rings of this area.
Sourcepub fn is_multipolygon(&self) -> bool
pub fn is_multipolygon(&self) -> bool
Check whether this area is a multipolygon, ie. whether it has more than one outer ring.
Sourcepub fn outer_rings(&self) -> impl Iterator<Item = &OuterRing>
pub fn outer_rings(&self) -> impl Iterator<Item = &OuterRing>
Return an iterator over all outer rings.
Sourcepub fn inner_rings<'a>(
&'a self,
outer: &'a OuterRing,
) -> impl Iterator<Item = &'a InnerRing> + 'a
pub fn inner_rings<'a>( &'a self, outer: &'a OuterRing, ) -> impl Iterator<Item = &'a InnerRing> + 'a
Return an iterator over all inner rings in the given outer ring.
Methods from Deref<Target = OSMObject>§
Sourcepub fn positive_id(&self) -> u64
pub fn positive_id(&self) -> u64
Get absolute value of the ID of this object.
Sourcepub fn user_is_anonymous(&self) -> bool
pub fn user_is_anonymous(&self) -> bool
Is this user anonymous?
Get the list of tags for this object.