• 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
  • tools
  • osm-addresses
  • pbf
PbfParser.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This file is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Copyright 2011 Dennis Nienhüser <earthwings@gentoo.org>
10 //
11 // This file originates from the MoNav project where it was named pbfreader.h and
12 // Copyright 2010 Christian Vetter veaac.fdirct@gmail.com
13 //
14 
15 #ifndef PBFPARSER_H
16 #define PBFPARSER_H
17 
18 #include "fileformat.pb.h"
19 #include "osmformat.pb.h"
20 #include "../OsmParser.h"
21 
22 #include <QString>
23 #include <QHash>
24 #include <QSet>
25 #include <QFile>
26 #include <QDataStream>
27 
28 class PbfParser : public Marble::OsmParser
29 {
30 public:
31  PbfParser();
32 
33  virtual bool parse( const QFileInfo &file, int pass, bool &needAnotherPass );
34 
35 private:
36  enum Mode {
37  ModeNode,
38  ModeWay,
39  ModeRelation,
40  ModeDense
41  };
42 
43  bool parseBlobHeader();
44 
45  bool parseBlob();
46 
47  bool parseData();
48 
49  bool readNext();
50 
51  void loadBlock();
52 
53  void loadGroup();
54 
55  void parseNode();
56 
57  void parseWay();
58 
59  void parseRelation();
60 
61  void parseDense();
62 
63  QByteArray m_buffer;
64 
65  QDataStream m_stream;
66 
67  OSMPBF::BlobHeader m_blobHeader;
68 
69  OSMPBF::Blob m_blob;
70 
71  OSMPBF::HeaderBlock m_headerBlock;
72 
73  OSMPBF::PrimitiveBlock m_primitiveBlock;
74 
75  Mode m_mode;
76 
77  int m_currentGroup;
78 
79  int m_currentEntity;
80 
81  bool m_loadBlock;
82 
83  long long m_lastDenseID;
84  long long m_lastDenseLatitude;
85  long long m_lastDenseLongitude;
86  int m_lastDenseTag;
87  int m_pass;
88 
89  QSet<int> m_referencedWays;
90  QSet<int> m_referencedNodes;
91 };
92 
93 #endif // PBFPARSER_H
PbfParser::PbfParser
PbfParser()
Definition: PbfParser.cpp:28
PbfParser
Definition: PbfParser.h:28
PbfParser::parse
virtual bool parse(const QFileInfo &file, int pass, bool &needAnotherPass)
Definition: PbfParser.cpp:36
Marble::OsmParser
Definition: src/plugins/runner/osm/OsmParser.h:17
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