KOSMIndoorMap

osmpbfparser.h
1 /*
2  SPDX-FileCopyrightText: 2020 Volker Krause <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef KOSM_OSMPBFPARSER_H
8 #define KOSM_OSMPBFPARSER_H
9 
10 #include "kosm_export.h"
11 
12 #include "datatypes.h"
13 
14 namespace OSMPBF {
15 class PrimitiveBlock;
16 class PrimitiveGroup;
17 }
18 
19 namespace OSM {
20 
21 /** Parser of .osm.pbf files.
22  * @see https://wiki.openstreetmap.org/wiki/PBF_Format
23  */
24 class KOSM_EXPORT OsmPbfParser
25 {
26 public:
27  explicit OsmPbfParser(DataSet *dataSet);
28 
29  /** Parse the given binary content.
30  * Feed this with QFile::map() for example.
31  */
32  void parse(const uint8_t *data, std::size_t len);
33 
34 private:
35  bool parseBlob(const uint8_t *&it, const uint8_t *end);
36  void parsePrimitiveBlock(const uint8_t *data, std::size_t len);
37  void parseDenseNodes(const OSMPBF::PrimitiveBlock &block, const OSMPBF::PrimitiveGroup &group);
38  void parseWays(const OSMPBF::PrimitiveBlock &block, const OSMPBF::PrimitiveGroup &group);
39  void parseRelations(const OSMPBF::PrimitiveBlock &block, const OSMPBF::PrimitiveGroup &group);
40 
41  DataSet *m_dataSet = nullptr;
42  QByteArray m_zlibBuffer;
43 };
44 
45 }
46 
47 #endif // KOSM_OSMPBFPARSER_H
Parser of .osm.pbf files.
Definition: osmpbfparser.h:24
A set of nodes, ways and relations.
Definition: datatypes.h:283
Low-level types and functions to work with raw OSM data as efficiently as possible.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:03:45 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.