Marble::OsmPlacemarkData

Search for usage in LXR

Marble::OsmPlacemarkData Class Reference

#include <OsmPlacemarkData.h>

Inheritance diagram for Marble::OsmPlacemarkData:

Public Member Functions

QString action () const
 
void addMemberReference (int key, const OsmPlacemarkData &value)
 
void addNodeReference (const GeoDataCoordinates &key, const OsmPlacemarkData &value)
 
void addRelation (qint64 id, OsmType type, const QString &role)
 
void addTag (const QString &key, const QString &value)
 
void changeNodeReference (const GeoDataCoordinates &oldKey, const GeoDataCoordinates &newKey)
 
QString changeset () const
 
bool containsMemberReference (int key) const
 
bool containsNodeReference (const GeoDataCoordinates &key) const
 
bool containsRelation (qint64 id) const
 
bool containsTag (const QString &key, const QString &value) const
 
bool containsTagKey (const QString &key) const
 
QHash< QString, QString >::const_iterator findTag (const QString &key) const
 
qint64 id () const
 
bool isEmpty () const
 
bool isNull () const
 
QString isVisible () const
 
OsmPlacemarkDatamemberReference (int key)
 
OsmPlacemarkData memberReference (int key) const
 
QHash< int, OsmPlacemarkData > & memberReferences ()
 
QHash< int, OsmPlacemarkData >::const_iterator memberReferencesBegin () const
 
QHash< int, OsmPlacemarkData >::const_iterator memberReferencesEnd () const
 
OsmPlacemarkDatanodeReference (const GeoDataCoordinates &coordinates)
 
OsmPlacemarkData nodeReference (const GeoDataCoordinates &coordinates) const
 
QHash< GeoDataCoordinates, OsmPlacemarkData > & nodeReferences ()
 
QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator nodeReferencesBegin () const
 
QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator nodeReferencesEnd () const
 
const char * nodeType () const override
 
qint64 oid () const
 
QHash< OsmIdentifier, QString >::const_iterator relationReferencesBegin () const
 
QHash< OsmIdentifier, QString >::const_iterator relationReferencesEnd () const
 
void removeMemberReference (int key)
 
void removeNodeReference (const GeoDataCoordinates &key)
 
void removeRelation (qint64 id)
 
void removeTag (const QString &key)
 
void setAction (const QString &action)
 
void setChangeset (const QString &changeset)
 
void setId (qint64 id)
 
void setTimestamp (const QString &timestamp)
 
void setUid (const QString &uid)
 
void setUser (const QString &user)
 
void setVersion (const QString &version)
 
void setVisible (const QString &visible)
 
QHash< QString, QString >::const_iterator tagsBegin () const
 
QHash< QString, QString >::const_iterator tagsEnd () const
 
QString tagValue (const QString &key) const
 
QString timestamp () const
 
QString uid () const
 
QString user () const
 
QString version () const
 

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.

Member Function Documentation

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.

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.

void Marble::OsmPlacemarkData::addRelation ( qint64  id,
OsmType  type,
const QString role 
)

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.

void Marble::OsmPlacemarkData::addTag ( const QString key,
const QString value 
)

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.

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.

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.

bool Marble::OsmPlacemarkData::containsTag ( const QString key,
const QString value 
) const

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.

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.

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.

OsmPlacemarkData Marble::OsmPlacemarkData::fromParserAttributes ( const QXmlStreamAttributes attributes)
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.

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.

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.

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.

OsmPlacemarkData & Marble::OsmPlacemarkData::nodeReference ( const GeoDataCoordinates coordinates)

this function returns the osmData associated with a nd

Definition at line 161 of file OsmPlacemarkData.cpp.

QHash< GeoDataCoordinates, OsmPlacemarkData > & Marble::OsmPlacemarkData::nodeReferences ( )

iterators for the reference hashes.

Definition at line 192 of file OsmPlacemarkData.cpp.

const char * Marble::OsmPlacemarkData::nodeType ( ) const
overridevirtual

Provides type information for downcasting a GeoNode.

Implements Marble::GeoNode.

Definition at line 323 of file OsmPlacemarkData.cpp.

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.

void Marble::OsmPlacemarkData::removeTag ( const QString key)

removeTag removes the tag from the tag hash

Definition at line 126 of file OsmPlacemarkData.cpp.

QHash< QString, QString >::const_iterator Marble::OsmPlacemarkData::tagsBegin ( ) const

iterators for the tags hash.

Definition at line 147 of file OsmPlacemarkData.cpp.

QString Marble::OsmPlacemarkData::tagValue ( const QString key) const

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.


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 Fri Nov 26 2021 23:23:32 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.