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

marble

  • sources
  • kde-4.12
  • 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 "GeoParser.h"
14 #include "GeoDataCoordinates.h"
15 #include "GeoDataPoint.h"
16 #include "OsmNodeFactory.h"
17 #include "OsmElementDictionary.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& parser ) const
29 {
30  // Osm Node http://wiki.openstreetmap.org/wiki/Data_Primitives#Node
31 
32  Q_ASSERT( parser.isStartElement() );
33 
34  qreal lon = parser.attribute( "lon" ).toDouble();
35  qreal lat = parser.attribute( "lat" ).toDouble();
36 
37  GeoDataPoint *point = new GeoDataPoint( lon, lat, 0, GeoDataCoordinates::Degree );
38  osm::OsmNodeFactory::appendPoint( parser.attribute( "id" ).toULongLong(), point );
39  return point;
40 }
41 
42 }
43 
44 }
Marble::GeoDataPoint
A Geometry object representing a 3d point.
Definition: GeoDataPoint.h:47
GeoDataCoordinates.h
OsmNodeFactory.h
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
GeoParser.h
Marble::osm::osmTag_node
const char * osmTag_node
Definition: OsmElementDictionary.cpp:23
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::osm::OsmNodeTagHandler::parse
virtual GeoNode * parse(GeoParser &) const
Definition: OsmNodeTagHandler.cpp:28
GeoDataPoint.h
Marble::osm::OsmNodeFactory::appendPoint
static void appendPoint(quint64 id, GeoDataPoint *p)
Definition: OsmNodeFactory.cpp:24
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-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:52 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
  • kstars
  • libkdeedu
  •   keduvocdocument
  • 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