OSM::Element

Search for usage in LXR

OSM::Element Class Reference

#include <element.h>

Public Member Functions

 Element (const Node *node)
 
 Element (const Way *way)
 
 Element (const Relation *relation)
 
BoundingBox boundingBox () const
 
Coordinate center () const
 
bool hasTag (TagKey key) const
 
bool hasTags () const
 
Id id () const
 
const Nodenode () const
 
 operator bool () const
 
bool operator!= (Element other) const
 
bool operator< (Element other) const
 
bool operator== (Element other) const
 
std::vector< const Node * > outerPath (const DataSet &dataSet) const
 
void recomputeBoundingBox (const DataSet &dataSet)
 
const Relationrelation () const
 
std::vector< Tag >::const_iterator tagsBegin () const
 
std::vector< Tag >::const_iterator tagsEnd () const
 
QByteArray tagValue (TagKey key) const
 
QByteArray tagValue (const char *keyName) const
 
QByteArray tagValue (const char *keyName, const QLocale &locale) const
 
template<typename K , typename... Args>
QByteArray tagValue (K key, Args...args) const
 
template<typename K , typename... Args>
QByteArray tagValue (K key, Args...args, const QLocale &locale) const
 
Type type () const
 
QString url () const
 
const Wayway () const
 

Detailed Description

A reference to any of OSM::Node/OSMWay/OSMRelation.

Lifetime of the referenced object needs to extend beyond the lifetime of this.

Definition at line 22 of file element.h.

Member Function Documentation

bool Element::hasTag ( TagKey  key) const

Returns true if this element has a tag with key key.

Definition at line 114 of file element.cpp.

bool OSM::Element::hasTags ( ) const
inline

Returns whether or not this element has any tags set.

Definition at line 52 of file element.h.

std::vector< const Node * > Element::outerPath ( const DataSet dataSet) const

Returns all nodes belonging to the outer path of this element.

In the simplest case that's a single closed polygon, but it can also be a sequence of multiple closed loop polygons, or a polyline.

Definition at line 166 of file element.cpp.

void Element::recomputeBoundingBox ( const DataSet dataSet)

Recompute the bounding box of this element.

We usually assume those to be provided by Overpass/osmconvert, but there seem to be cases where those aren't reliable.

Definition at line 207 of file element.cpp.

template<typename K , typename... Args>
QByteArray OSM::Element::tagValue ( key,
Args...  args 
) const

Returns the value of the first non-empty tag.

Both OSM::TagKey (fast) and const char* (slow) keys are accepted.

Definition at line 77 of file element.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:03:46 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.