1#ifndef OSMSCOUT_IMPORT_PREPROCESS_PBF_H
2#define OSMSCOUT_IMPORT_PREPROCESS_PBF_H
25#include <unordered_map>
34#if defined(OSMSCOUT_IMPORT_MESON_BUILD) || defined(OSMSCOUT_IMPORT_CMAKE_BUILD)
35 #include <fileformat.pb.h>
36 #include <osmformat.pb.h>
38 #include <osmscoutimport/pbf/fileformat.pb.h>
39 #include <osmscoutimport/pbf/osmformat.pb.h>
50 google::protobuf::int32 bufferSize;
51 PreprocessorCallback& callback;
53 std::vector<OSMId> nodes;
54 std::vector<RawRelation::Member> members;
57 bool GetPos(FILE* file,
58 FileOffset& pos)
const;
60 void AssureBlockSize(google::protobuf::int32 length);
62 bool ReadBlockHeader(Progress& progress,
64 OSMPBF::BlobHeader& blockHeader,
67 bool ReadHeaderBlock(Progress& progress,
69 const OSMPBF::BlobHeader& blockHeader,
70 OSMPBF::HeaderBlock& headerBlock);
72 bool ReadPrimitiveBlock(Progress& progress,
74 const OSMPBF::BlobHeader& blockHeader,
75 OSMPBF::PrimitiveBlock& primitiveBlock);
77 void ReadNodes(
const TypeConfig& typeConfig,
78 const OSMPBF::PrimitiveBlock& block,
79 const OSMPBF::PrimitiveGroup &group,
80 PreprocessorCallback::RawBlockData& data);
82 void ReadDenseNodes(
const TypeConfig& typeConfig,
83 const OSMPBF::PrimitiveBlock& block,
84 const OSMPBF::PrimitiveGroup &group,
85 PreprocessorCallback::RawBlockData& data);
87 void ReadWays(
const TypeConfig& typeConfig,
88 const OSMPBF::PrimitiveBlock& block,
89 const OSMPBF::PrimitiveGroup &group,
90 PreprocessorCallback::RawBlockData& data);
92 void ReadRelations(
const TypeConfig& typeConfig,
93 const OSMPBF::PrimitiveBlock& block,
94 const OSMPBF::PrimitiveGroup &group,
95 PreprocessorCallback::RawBlockData& data);
97 void ProcessBlock(
const TypeConfigRef& typeConfig,
98 std::unique_ptr<OSMPBF::PrimitiveBlock>&& block);
107 const std::string& filename)
override;
bool Import(const TypeConfigRef &typeConfig, const ImportParameter ¶meter, Progress &progress, const std::string &filename) override
PreprocessPBF(PreprocessorCallback &callback)
~PreprocessPBF() override
Definition Preprocessor.h:36
Definition Preprocessor.h:86
std::shared_ptr< TypeConfig > TypeConfigRef
Definition TypeConfig.h:1396
std::unordered_map< TagId, std::string > TagMap
Definition Tag.h:41