Marble::OsmPlacemarkData
#include <OsmPlacemarkData.h>
Static Public Member Functions | |
static OsmPlacemarkData | fromParserAttributes (const QXmlStreamAttributes &attributes) |
Detailed Description
This class is used to encapsulate the osm data fields kept within a placemark's extendedData.
It stores OSM server generated data: id, version, changeset, uid, visible, user, timestamp; It also stores a hash map of <tags> ( key-value mappings ) and a hash map of component osm placemarks
- See also
- m_nodeReferences
- m_memberReferences
The usual workflow with osmData goes as follows:
Parsing stage: The OsmParser parses tags (they have server-generated attributes), creates new placemarks and assigns them new OsmPlacemarkData objects with all the needed information.
Editing stage: While editing placemarks that have OsmPlacemarkData, all relevant changes reflect on the OsmPlacemarkData object as well, so as not to uncorrelate data from the actual placemarks.
Writing stage: The OsmObjectManager assigns OsmPlacemarkData objects to placemarks that do not have it ( these are usually newly created placemarks within the editor, or placemarks loaded from ".kml" files ). Placemarks that already have it, are simply written as-is.
Definition at line 66 of file OsmPlacemarkData.h.
Constructor & Destructor Documentation
◆ OsmPlacemarkData()
Marble::OsmPlacemarkData::OsmPlacemarkData | ( | ) |
Definition at line 22 of file OsmPlacemarkData.cpp.
Member Function Documentation
◆ action()
QString Marble::OsmPlacemarkData::action | ( | ) | const |
Definition at line 69 of file OsmPlacemarkData.cpp.
◆ addMemberReference()
void Marble::OsmPlacemarkData::addMemberReference | ( | int | key, |
const OsmPlacemarkData & | value ) |
addRef this function inserts a int = OsmplacemarkData mapping into the reference hash, equivalent to the osm <nd ref="@p boundary of index @key" > core data element
- See also
- m_memberReferences
Definition at line 219 of file OsmPlacemarkData.cpp.
◆ addNodeReference()
void Marble::OsmPlacemarkData::addNodeReference | ( | const GeoDataCoordinates & | key, |
const OsmPlacemarkData & | value ) |
addRef this function inserts a GeoDataCoordinates = OsmPlacemarkData mapping into the reference hash, equivalent to the <member ref="@p key" > osm core data element
Definition at line 171 of file OsmPlacemarkData.cpp.
◆ addRelation()
addRelation calling this makes the osm placemark a member of the relation with id
as id, while having the role role
Definition at line 263 of file OsmPlacemarkData.cpp.
◆ addTag()
addTag this function inserts a string key=value mapping, equivalent to the <tag k="@p key" v="@p value"> osm core data element
Definition at line 121 of file OsmPlacemarkData.cpp.
◆ changeNodeReference()
void Marble::OsmPlacemarkData::changeNodeReference | ( | const GeoDataCoordinates & | oldKey, |
const GeoDataCoordinates & | newKey ) |
changeNodeReference is a convenience function that allows the quick change of a node hash entry.
This is generally used to update the osm data in case nodes are being moved in the editor.
Definition at line 186 of file OsmPlacemarkData.cpp.
◆ changeset()
QString Marble::OsmPlacemarkData::changeset | ( | ) | const |
Definition at line 39 of file OsmPlacemarkData.cpp.
◆ containsMemberReference()
bool Marble::OsmPlacemarkData::containsMemberReference | ( | int | key | ) | const |
Definition at line 243 of file OsmPlacemarkData.cpp.
◆ containsNodeReference()
bool Marble::OsmPlacemarkData::containsNodeReference | ( | const GeoDataCoordinates & | key | ) | const |
Definition at line 181 of file OsmPlacemarkData.cpp.
◆ containsRelation()
bool Marble::OsmPlacemarkData::containsRelation | ( | qint64 | id | ) | const |
this is wrong and just done this way for backward behavior compatible
this method should probably take type as an additional argument
Definition at line 277 of file OsmPlacemarkData.cpp.
◆ containsTag()
containsTag returns true if the tag hash contains an entry with the key
as key and value
as value
Definition at line 131 of file OsmPlacemarkData.cpp.
◆ containsTagKey()
bool Marble::OsmPlacemarkData::containsTagKey | ( | const QString & | key | ) | const |
containsTagKey returns true if the tag hash contains an entry with the key
as key
Definition at line 137 of file OsmPlacemarkData.cpp.
◆ findTag()
QHash< QString, QString >::const_iterator Marble::OsmPlacemarkData::findTag | ( | const QString & | key | ) | const |
tagValue returns a pointer to the tag that has key
as key or the end iterator if there is no such tag
Definition at line 142 of file OsmPlacemarkData.cpp.
◆ fromParserAttributes()
|
static |
fromParserAttributes is a convenience function that parses all osm-related arguments of a tag
- Returns
- an OsmPlacemarkData object containing all the necessary data
Definition at line 309 of file OsmPlacemarkData.cpp.
◆ id()
qint64 Marble::OsmPlacemarkData::id | ( | ) | const |
Definition at line 28 of file OsmPlacemarkData.cpp.
◆ isEmpty()
bool Marble::OsmPlacemarkData::isEmpty | ( | ) | const |
isEmpty returns true if no attribute other than the id has been set
Definition at line 301 of file OsmPlacemarkData.cpp.
◆ isNull()
bool Marble::OsmPlacemarkData::isNull | ( | ) | const |
isNull returns false if the osmData is loaded from a source or true if its just default constructed
Definition at line 296 of file OsmPlacemarkData.cpp.
◆ isVisible()
QString Marble::OsmPlacemarkData::isVisible | ( | ) | const |
Definition at line 54 of file OsmPlacemarkData.cpp.
◆ memberReference() [1/2]
OsmPlacemarkData & Marble::OsmPlacemarkData::memberReference | ( | int | key | ) |
this function returns the osmData associated with a member boundary's index -1 represents the outer boundary of a polygon, and 0,1,2... the inner boundaries, in the order provided by polygon->innerBoundaries();
Definition at line 208 of file OsmPlacemarkData.cpp.
◆ memberReference() [2/2]
OsmPlacemarkData Marble::OsmPlacemarkData::memberReference | ( | int | key | ) | const |
Definition at line 213 of file OsmPlacemarkData.cpp.
◆ memberReferences()
QHash< int, OsmPlacemarkData > & Marble::OsmPlacemarkData::memberReferences | ( | ) |
Definition at line 248 of file OsmPlacemarkData.cpp.
◆ memberReferencesBegin()
QHash< int, OsmPlacemarkData >::const_iterator Marble::OsmPlacemarkData::memberReferencesBegin | ( | ) | const |
Definition at line 253 of file OsmPlacemarkData.cpp.
◆ memberReferencesEnd()
QHash< int, OsmPlacemarkData >::const_iterator Marble::OsmPlacemarkData::memberReferencesEnd | ( | ) | const |
Definition at line 258 of file OsmPlacemarkData.cpp.
◆ nodeReference() [1/2]
OsmPlacemarkData & Marble::OsmPlacemarkData::nodeReference | ( | const GeoDataCoordinates & | coordinates | ) |
this function returns the osmData associated with a nd
Definition at line 161 of file OsmPlacemarkData.cpp.
◆ nodeReference() [2/2]
OsmPlacemarkData Marble::OsmPlacemarkData::nodeReference | ( | const GeoDataCoordinates & | coordinates | ) | const |
Definition at line 166 of file OsmPlacemarkData.cpp.
◆ nodeReferences()
QHash< GeoDataCoordinates, OsmPlacemarkData > & Marble::OsmPlacemarkData::nodeReferences | ( | ) |
iterators for the reference hashes.
Definition at line 192 of file OsmPlacemarkData.cpp.
◆ nodeReferencesBegin()
QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator Marble::OsmPlacemarkData::nodeReferencesBegin | ( | ) | const |
Definition at line 197 of file OsmPlacemarkData.cpp.
◆ nodeReferencesEnd()
QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator Marble::OsmPlacemarkData::nodeReferencesEnd | ( | ) | const |
Definition at line 202 of file OsmPlacemarkData.cpp.
◆ nodeType()
|
overridevirtual |
Provides type information for downcasting a GeoNode.
Implements Marble::GeoNode.
Definition at line 337 of file OsmPlacemarkData.cpp.
◆ oid()
qint64 Marble::OsmPlacemarkData::oid | ( | ) | const |
Definition at line 33 of file OsmPlacemarkData.cpp.
◆ relationReferencesBegin()
QHash< OsmIdentifier, QString >::const_iterator Marble::OsmPlacemarkData::relationReferencesBegin | ( | ) | const |
Definition at line 286 of file OsmPlacemarkData.cpp.
◆ relationReferencesEnd()
QHash< OsmIdentifier, QString >::const_iterator Marble::OsmPlacemarkData::relationReferencesEnd | ( | ) | const |
Definition at line 291 of file OsmPlacemarkData.cpp.
◆ removeMemberReference()
void Marble::OsmPlacemarkData::removeMemberReference | ( | int | key | ) |
Definition at line 224 of file OsmPlacemarkData.cpp.
◆ removeNodeReference()
void Marble::OsmPlacemarkData::removeNodeReference | ( | const GeoDataCoordinates & | key | ) |
Definition at line 176 of file OsmPlacemarkData.cpp.
◆ removeRelation()
void Marble::OsmPlacemarkData::removeRelation | ( | qint64 | id | ) |
this is wrong and just done this way for backward behavior compatible
this method should probably take type as an additional argument
Definition at line 268 of file OsmPlacemarkData.cpp.
◆ removeTag()
void Marble::OsmPlacemarkData::removeTag | ( | const QString & | key | ) |
removeTag removes the tag from the tag hash
Definition at line 126 of file OsmPlacemarkData.cpp.
◆ setAction()
void Marble::OsmPlacemarkData::setAction | ( | const QString & | action | ) |
Definition at line 109 of file OsmPlacemarkData.cpp.
◆ setChangeset()
void Marble::OsmPlacemarkData::setChangeset | ( | const QString & | changeset | ) |
Definition at line 84 of file OsmPlacemarkData.cpp.
◆ setId()
void Marble::OsmPlacemarkData::setId | ( | qint64 | id | ) |
Definition at line 74 of file OsmPlacemarkData.cpp.
◆ setTimestamp()
void Marble::OsmPlacemarkData::setTimestamp | ( | const QString & | timestamp | ) |
Definition at line 104 of file OsmPlacemarkData.cpp.
◆ setUid()
void Marble::OsmPlacemarkData::setUid | ( | const QString & | uid | ) |
Definition at line 89 of file OsmPlacemarkData.cpp.
◆ setUser()
void Marble::OsmPlacemarkData::setUser | ( | const QString & | user | ) |
Definition at line 99 of file OsmPlacemarkData.cpp.
◆ setVersion()
void Marble::OsmPlacemarkData::setVersion | ( | const QString & | version | ) |
Definition at line 79 of file OsmPlacemarkData.cpp.
◆ setVisible()
void Marble::OsmPlacemarkData::setVisible | ( | const QString & | visible | ) |
Definition at line 94 of file OsmPlacemarkData.cpp.
◆ tagsBegin()
iterators for the tags hash.
Definition at line 147 of file OsmPlacemarkData.cpp.
◆ tagsEnd()
Definition at line 152 of file OsmPlacemarkData.cpp.
◆ tagValue()
tagValue returns the value of the tag that has key
as key or an empty qstring if there is no such tag
Definition at line 116 of file OsmPlacemarkData.cpp.
◆ timestamp()
QString Marble::OsmPlacemarkData::timestamp | ( | ) | const |
Definition at line 64 of file OsmPlacemarkData.cpp.
◆ uid()
QString Marble::OsmPlacemarkData::uid | ( | ) | const |
Definition at line 49 of file OsmPlacemarkData.cpp.
◆ user()
QString Marble::OsmPlacemarkData::user | ( | ) | const |
Definition at line 59 of file OsmPlacemarkData.cpp.
◆ version()
QString Marble::OsmPlacemarkData::version | ( | ) | const |
Definition at line 44 of file OsmPlacemarkData.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Sep 13 2024 11:53:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.