Public Member Functions | Data Fields
osm::Relation Class Reference

Represents a relation in OpenStreetMap. More...

#include <Relation.h>

Inheritance diagram for osm::Relation:
osm::Element

Public Member Functions

 Relation ()
 Relation (int64_t id)
 Constructs a Relation with given id.
virtual ~Relation ()
boost::property_tree::ptree get_description ()
osm::ObjectType get_type () const
bool operator== (Relation const &r) const
bool operator!= (Relation const &r) const
void fill (osmdb::PropertiesSelection &db)
 Fill attributes and possibly other information from db.
void add_to_relation (osmdb::ElementImporter &db, int64_t relation, std::string const &role)
 Execute the needed method of db to insert this element as member into relation.
virtual int64_t get_id () const
void add_node (std::string const &role, osm::Node const &nd)
void add_way (std::string const &role, osm::Way const &w)
void add_rel (std::string const &role, osm::Relation const &r)

Data Fields

int64_t id
std::multimap< std::string,
std::shared_ptr< osm::Element > > 
members
 Member elements of this relation.
std::set< osm::Tagtags
 Attributes of this relation.

Detailed Description

Represents a relation in OpenStreetMap.

Definition at line 26 of file Relation.h.


Constructor & Destructor Documentation

osm::Relation::Relation ( )

Definition at line 16 of file Relation.cpp.

osm::Relation::Relation ( int64_t  id)

Constructs a Relation with given id.

Parameters:
id

Definition at line 20 of file Relation.cpp.

osm::Relation::~Relation ( ) [virtual]

Definition at line 25 of file Relation.cpp.


Member Function Documentation

void osm::Relation::add_node ( std::string const &  role,
osm::Node const &  nd 
)

Definition at line 98 of file Relation.cpp.

void osm::Relation::add_rel ( std::string const &  role,
osm::Relation const &  r 
)

Definition at line 108 of file Relation.cpp.

void osm::Relation::add_to_relation ( osmdb::ElementImporter db,
int64_t  parentid,
std::string const &  role 
) [virtual]

Execute the needed method of db to insert this element as member into relation.

Parameters:
dbto use when inserting
parentidrelation id
rolerole to use when inserting

Implements osm::Element.

Definition at line 93 of file Relation.cpp.

void osm::Relation::add_way ( std::string const &  role,
osm::Way const &  w 
)

Definition at line 103 of file Relation.cpp.

void osm::Relation::fill ( osmdb::PropertiesSelection db) [virtual]

Fill attributes and possibly other information from db.

Parameters:
db

Implements osm::Element.

Definition at line 69 of file Relation.cpp.

boost::property_tree::ptree osm::Relation::get_description ( ) [virtual]
Returns:
a description of this element (used for displaying)

Implements osm::Element.

Definition at line 45 of file Relation.cpp.

int64_t osm::Relation::get_id ( ) const [virtual]
Returns:
id of this element

Implements osm::Element.

Definition at line 113 of file Relation.cpp.

osm::ObjectType osm::Relation::get_type ( ) const [virtual]
Returns:
the type of this element

Implements osm::Element.

Definition at line 29 of file Relation.cpp.

bool osm::Relation::operator!= ( Relation const &  r) const

Definition at line 40 of file Relation.cpp.

bool osm::Relation::operator== ( Relation const &  r) const

Definition at line 34 of file Relation.cpp.


Field Documentation

Definition at line 36 of file Relation.h.

std::multimap<std::string, std::shared_ptr<osm::Element> > osm::Relation::members

Member elements of this relation.

Definition at line 40 of file Relation.h.

Attributes of this relation.

Definition at line 44 of file Relation.h.


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines