Libosmium  2.22.0
Fast and flexible C++ library for working with OpenStreetMap data
Loading...
Searching...
No Matches
osmium::Area Class Reference

#include <area.hpp>

Inheritance diagram for osmium::Area:
Collaboration diagram for osmium::Area:

Public Member Functions

bool from_way () const noexcept
 
osmium::object_id_type orig_id () const noexcept
 
std::pair< size_t, size_t > num_rings () const
 
bool is_multipolygon () const
 
osmium::memory::ItemIteratorRange< const osmium::OuterRingouter_rings () const
 
osmium::memory::ItemIteratorRange< const osmium::InnerRinginner_rings (const osmium::OuterRing &outer) const
 
osmium::Box envelope () const noexcept
 
- Public Member Functions inherited from osmium::OSMObject
object_id_type id () const noexcept
 Get ID of this object.
 
unsigned_object_id_type positive_id () const noexcept
 Get absolute value of the ID of this object.
 
OSMObjectset_id (object_id_type id) noexcept
 
OSMObjectset_id (const char *id)
 
bool deleted () const noexcept
 Is this object marked as deleted?
 
bool visible () const noexcept
 Is this object marked visible (ie not deleted)?
 
OSMObjectset_deleted (bool deleted) noexcept
 
OSMObjectset_visible (bool visible) noexcept
 
OSMObjectset_visible (const char *visible)
 
object_version_type version () const noexcept
 Get version of this object.
 
OSMObjectset_version (object_version_type version) noexcept
 
OSMObjectset_version (const char *version)
 
changeset_id_type changeset () const noexcept
 Get changeset id of this object.
 
OSMObjectset_changeset (changeset_id_type changeset) noexcept
 
OSMObjectset_changeset (const char *changeset)
 
user_id_type uid () const noexcept
 Get user id of this object.
 
OSMObjectset_uid (user_id_type uid) noexcept
 
OSMObjectset_uid_from_signed (signed_user_id_type uid) noexcept
 
OSMObjectset_uid (const char *uid)
 
bool user_is_anonymous () const noexcept
 Is this user anonymous?
 
osmium::Timestamp timestamp () const noexcept
 Get timestamp when this object last changed.
 
OSMObjectset_timestamp (const osmium::Timestamp &timestamp) noexcept
 
OSMObjectset_timestamp (const char *timestamp)
 
const char * user () const noexcept
 Get user name for this object.
 
void clear_user () noexcept
 Clear user name.
 
const TagListtags () const
 Get the list of tags for this object.
 
const char * get_value_by_key (const char *key, const char *default_value=nullptr) const noexcept
 
OSMObjectset_attribute (const char *attr, const char *value)
 
void remove_tags () noexcept
 
iterator begin ()
 
iterator end ()
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
const_iterator end () const
 
template<typename T>
osmium::memory::ItemIteratorRange< T > subitems ()
 
template<typename T>
osmium::memory::ItemIteratorRange< const T > subitems () const
 
template<typename T>
t_iterator< T > begin ()
 
template<typename T>
t_iterator< T > end ()
 
template<typename T>
t_const_iterator< T > cbegin () const
 
template<typename T>
t_const_iterator< T > cend () const
 
template<typename T>
t_const_iterator< T > begin () const
 
template<typename T>
t_const_iterator< T > end () const
 
- Public Member Functions inherited from osmium::OSMEntity
 OSMEntity (osmium::memory::item_size_type size, osmium::item_type type)
 
bool type_is_in (osmium::osm_entity_bits::type entity_bits) const
 
- Public Member Functions inherited from osmium::memory::Item
 Item (const Item &)=delete
 
Itemoperator= (const Item &)=delete
 
 Item (Item &&)=delete
 
Itemoperator= (Item &&)=delete
 
 ~Item () noexcept=default
 
unsigned char * next () noexcept
 
const unsigned char * next () const noexcept
 
item_size_type byte_size () const noexcept
 
item_size_type padded_size () const
 
item_type type () const noexcept
 
bool removed () const noexcept
 
void set_removed (const bool removed) noexcept
 
diff_indicator_type diff () const noexcept
 
char diff_as_char () const noexcept
 
void set_diff (const diff_indicator_type diff) noexcept
 

Static Public Member Functions

static constexpr bool is_compatible_to (osmium::item_type t) noexcept
 
- Static Public Member Functions inherited from osmium::OSMObject
static constexpr bool is_compatible_to (osmium::item_type t) noexcept
 
- Static Public Member Functions inherited from osmium::OSMEntity
static constexpr bool is_compatible_to (osmium::item_type t) noexcept
 
- Static Public Member Functions inherited from osmium::memory::Item
static constexpr bool is_compatible_to (osmium::item_type) noexcept
 

Static Public Attributes

static constexpr osmium::item_type itemtype = osmium::item_type::area
 

Private Member Functions

 Area ()
 

Friends

template<typename TDerived, typename T>
class osmium::builder::OSMObjectBuilder
 

Additional Inherited Members

- Public Types inherited from osmium::OSMObject
using iterator = osmium::memory::CollectionIterator<Item>
 
using const_iterator = osmium::memory::CollectionIterator<const Item>
 
template<typename T>
using t_iterator = osmium::memory::ItemIterator<T>
 
template<typename T>
using t_const_iterator = osmium::memory::ItemIterator<const T>
 
- Protected Member Functions inherited from osmium::OSMObject
 OSMObject (osmium::memory::item_size_type size, osmium::item_type type)
 
- Protected Member Functions inherited from osmium::memory::Item
 Item (item_size_type size=0, item_type type=item_type{}) noexcept
 
Itemset_type (const item_type item_type) noexcept
 

Detailed Description

An OSM area created out of a closed way or a multipolygon relation.

Constructor & Destructor Documentation

◆ Area()

osmium::Area::Area ( )
inlineprivate

Member Function Documentation

◆ envelope()

osmium::Box osmium::Area::envelope ( ) const
inlinenoexcept

Calculate the envelope of this area.

Complexity: Linear in the number of nodes in the outer rings.

◆ from_way()

bool osmium::Area::from_way ( ) const
inlinenoexcept

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

Complexity: Constant.

◆ inner_rings()

osmium::memory::ItemIteratorRange< const osmium::InnerRing > osmium::Area::inner_rings ( const osmium::OuterRing & outer) const
inline

Return an iterator range for all inner rings in the given outer ring. You can use the usual begin() and end() functions to iterate over all inner rings.

◆ is_compatible_to()

static constexpr bool osmium::Area::is_compatible_to ( osmium::item_type t)
inlinestaticconstexprnoexcept

◆ is_multipolygon()

bool osmium::Area::is_multipolygon ( ) const
inline

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

◆ num_rings()

std::pair< size_t, size_t > osmium::Area::num_rings ( ) const
inline

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

Complexity: Linear in the number of rings.

Returns
Pair (number outer rings, number inner rings)

◆ orig_id()

osmium::object_id_type osmium::Area::orig_id ( ) const
inlinenoexcept

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

Complexity: Constant.

◆ outer_rings()

osmium::memory::ItemIteratorRange< const osmium::OuterRing > osmium::Area::outer_rings ( ) const
inline

Return an iterator range for all outer rings. You can use the usual begin() and end() functions to iterate over all outer rings.

Friends And Related Symbol Documentation

◆ osmium::builder::OSMObjectBuilder

template<typename TDerived, typename T>
friend class osmium::builder::OSMObjectBuilder
friend

Member Data Documentation

◆ itemtype

osmium::item_type osmium::Area::itemtype = osmium::item_type::area
staticconstexpr

The documentation for this class was generated from the following file: