OSM::DataSet
#include <datatypes.h>
Public Member Functions | |
DataSet (const DataSet &)=delete | |
DataSet (DataSet &&other) noexcept | |
void | addNode (Node &&node) |
void | addRelation (Relation &&rel) |
void | addWay (Way &&way) |
Role | makeRole (const char *roleName, StringMemory memOpt=StringMemory::Transient) |
TagKey | makeTagKey (const char *keyName, StringMemory keyMemOpt=StringMemory::Transient) |
Id | nextInternalId () const |
const Node * | node (Id id) const |
DataSet & | operator= (const DataSet &)=delete |
DataSet & | operator= (DataSet &&) noexcept |
const Relation * | relation (Id id) const |
Role | role (const char *roleName) const |
TagKey | tagKey (const char *keyName) const |
Way * | way (Id id) |
const Way * | way (Id id) const |
Public Attributes | |
std::vector< Node > | nodes |
std::vector< Relation > | relations |
const std::vector< Node > * | transientNodes = nullptr |
std::vector< Way > | ways |
Detailed Description
A set of nodes, ways and relations.
Definition at line 346 of file datatypes.h.
Member Function Documentation
◆ addNode()
void DataSet::addNode | ( | Node && | node | ) |
Definition at line 88 of file datatypes.cpp.
◆ addRelation()
void DataSet::addRelation | ( | Relation && | rel | ) |
Definition at line 108 of file datatypes.cpp.
◆ addWay()
void DataSet::addWay | ( | Way && | way | ) |
Definition at line 98 of file datatypes.cpp.
◆ makeRole()
|
nodiscard |
◆ makeTagKey()
|
nodiscard |
Create a tag key for the given tag name.
If none exist yet a new one is created. Use this for creating tags, not for lookup, prefer tagKey() for that.
- Parameters
-
keyMemOpt specifies whether keyName
is persisent for the lifetime of this instance and thus can be used without requiring a copy. If the memory is transient the string is copied if needed, and released in the DataSet destructor.
Definition at line 28 of file datatypes.cpp.
◆ nextInternalId()
|
nodiscard |
Create a unique id for internal use (ie.
one that will not clash with official OSM ids).
Definition at line 118 of file datatypes.cpp.
◆ node()
Find a node by its id.
- Returns
nullptr
if the node doesn't exist.
Definition at line 48 of file datatypes.cpp.
◆ relation()
Find a relation by its id.
- Returns
nullptr
if the relation doesn't exist.
Definition at line 79 of file datatypes.cpp.
◆ role()
|
nodiscard |
◆ tagKey()
|
nodiscard |
Look up a tag key for the given tag name, if it exists.
If no key exists, an empty/invalid/null key is returned. Use this for tag lookup, not for creating/adding tags.
Definition at line 38 of file datatypes.cpp.
◆ way() [1/2]
Definition at line 70 of file datatypes.cpp.
◆ way() [2/2]
Find a way by its id.
- Returns
nullptr
if the way doesn't exist.
Definition at line 61 of file datatypes.cpp.
Member Data Documentation
◆ nodes
std::vector<Node> OSM::DataSet::nodes |
Definition at line 402 of file datatypes.h.
◆ relations
std::vector<Relation> OSM::DataSet::relations |
Definition at line 404 of file datatypes.h.
◆ transientNodes
const std::vector<Node>* OSM::DataSet::transientNodes = nullptr |
Dynamically created nodes for overlays with new geometry.
Definition at line 408 of file datatypes.h.
◆ ways
std::vector<Way> OSM::DataSet::ways |
Definition at line 403 of file datatypes.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.