Enum libosmium::Area

source ·
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§

Was this area created from a way? (In contrast to areas created from a relation and their members.)

Return the Id of the way or relation this area was created from.

Count the number of outer and inner rings of this area.

Check whether this area is a multipolygon, ie. whether it has more than one outer ring.

Return an iterator over all outer rings.

Return an iterator over all inner rings in the given outer ring.

Methods from Deref<Target = OSMObject>§

Get ID of this object.

Get absolute value of the ID of this object.

Is this object marked as deleted?

Is this object marked visible (ie not deleted)?

Get version of this object.

Get user id of this object.

Is this user anonymous?

Get timestamp when this object last changed.

Get user name for this object.

Get the list of tags for this object.

Trait Implementations§

Cast to an crate::item::Item reference

Cast to an crate::object::OSMObject reference

Cast to an crate::item::Item reference

Cast to an crate::object::OSMObject reference

Cast to an [$crate :: object :: OSMObject] reference

The resulting type after dereferencing.

Cast to an [$crate :: object :: OSMObject] reference

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.