• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • runner
  • osm
  • handlers
OsmNodeTagHandler.cpp
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2011 Konstantin Oblaukhov <oblaukhov.konstantin@gmail.com>
9 //
10 
11 #include "OsmNodeTagHandler.h"
12 
13 #include "OsmElementDictionary.h"
14 #include "OsmParser.h"
15 
16 #include "GeoDataCoordinates.h"
17 #include "GeoDataPoint.h"
18 
19 namespace Marble
20 {
21 
22 namespace osm
23 {
24 
25 static GeoTagHandlerRegistrar osmNodeTagHandler( GeoParser::QualifiedName( osmTag_node, "" ),
26  new OsmNodeTagHandler() );
27 
28 GeoNode* OsmNodeTagHandler::parse( GeoParser &geoParser ) const
29 {
30  // Osm Node http://wiki.openstreetmap.org/wiki/Data_Primitives#Node
31 
32  Q_ASSERT( dynamic_cast<OsmParser *>( &geoParser ) );
33  OsmParser &parser = static_cast<OsmParser &>( geoParser );
34  Q_ASSERT( parser.isStartElement() );
35 
36  qreal lon = parser.attribute( "lon" ).toDouble();
37  qreal lat = parser.attribute( "lat" ).toDouble();
38 
39  GeoDataPoint *point = new GeoDataPoint( lon, lat, 0, GeoDataCoordinates::Degree );
40  parser.setNode( parser.attribute( "id" ).toULongLong(), point );
41  return point;
42 }
43 
44 }
45 
46 }
Marble::GeoDataPoint
A Geometry object representing a 3d point.
Definition: GeoDataPoint.h:47
GeoDataCoordinates.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::osm::osmTag_node
const char * osmTag_node
Definition: OsmElementDictionary.cpp:23
QString::toDouble
double toDouble(bool *ok) const
Marble::GeoDataCoordinates::Degree
Definition: GeoDataCoordinates.h:66
Marble::GeoParser
Definition: GeoParser.h:40
OsmElementDictionary.h
OsmNodeTagHandler.h
Marble::GeoParser::attribute
QString attribute(const char *attributeName) const
Definition: GeoParser.cpp:200
Marble::OsmParser::setNode
void setNode(quint64 id, GeoDataPoint *point)
Definition: src/plugins/runner/osm/OsmParser.cpp:66
QString::toULongLong
qulonglong toULongLong(bool *ok, int base) const
Marble::osm::OsmNodeTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: OsmNodeTagHandler.cpp:28
QXmlStreamReader::isStartElement
bool isStartElement() const
GeoDataPoint.h
Marble::OsmParser
Definition: src/plugins/runner/osm/OsmParser.h:29
Marble::GeoParser::QualifiedName
QPair< QString, QString > QualifiedName
Definition: GeoParser.h:43
Marble::osm::osmNodeTagHandler
static GeoTagHandlerRegistrar osmNodeTagHandler(GeoParser::QualifiedName(osmTag_node,""), new OsmNodeTagHandler())
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal