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 <osmscout/import/pbf/fileformat.pb.h> 39 #include <osmscout/import/pbf/osmformat.pb.h> 46 class PreprocessPBF
CLASS_FINAL :
public Preprocessor
50 google::protobuf::int32 bufferSize;
51 PreprocessorCallback& callback;
53 std::vector<OSMId> nodes;
54 std::vector<RawRelation::Member> members;
57 bool GetPos(FILE* file,
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);
98 std::unique_ptr<OSMPBF::PrimitiveBlock>&& block);
101 explicit PreprocessPBF(PreprocessorCallback& callback);
102 ~PreprocessPBF()
override;
105 const ImportParameter& parameter,
107 const std::string& filename)
override;
#define CLASS_FINAL
Definition: Compiler.h:26
uint64_t FileOffset
Definition: OSMScoutTypes.h:47
std::unordered_map< TagId, std::string > TagMap
Definition: Tag.h:41
std::shared_ptr< TypeConfig > TypeConfigRef
Definition: TypeConfig.h:1227