Commit 786db590 authored by Volker Krause's avatar Volker Krause
Browse files

Add OSM::UniqueElement::setId

Useful for cloning elements.
parent eb29b816
......@@ -246,6 +246,23 @@ UniqueElement::~UniqueElement()
}
}
void UniqueElement::setId(Id id)
{
switch (m_element.type()) {
case OSM::Type::Null:
return;
case OSM::Type::Node:
const_cast<Node*>(m_element.node())->id = id;
break;
case OSM::Type::Way:
const_cast<Way*>(m_element.way())->id = id;
break;
case OSM::Type::Relation:
const_cast<Relation*>(m_element.relation())->id = id;
break;
}
}
void UniqueElement::setTagValue(TagKey key, const QByteArray &value)
{
switch (m_element.type()) {
......
......@@ -123,6 +123,7 @@ public:
constexpr inline Element element() const { return m_element; }
constexpr inline operator Element() const { return m_element; }
void setId(Id id);
void setTagValue(TagKey key, const QByteArray &value);
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment