libosmscout 1.1.1
Loading...
Searching...
No Matches
Preprocessor.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_IMPORT_PREPROCESSOR_H
2#define OSMSCOUT_IMPORT_PREPROCESSOR_H
3
4/*
5 This source is part of the libosmscout library
6 Copyright (C) 2015 Tim Teulings
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21*/
22
23#include <unordered_map>
24
25#include <osmscout/Tag.h>
26#include <osmscout/TypeConfig.h>
29
32
33namespace osmscout {
34
36 {
37 public:
39 {
41 GeoCoord coord;
43
44 RawNodeData() = default;
45
47 const GeoCoord& coord)
48 : id(id),
50 {
51 // no code
52 }
53 };
54
56 {
59 std::vector<OSMId> nodes;
60 };
61
63 {
66 std::vector<RawRelation::Member> members;
67 };
68
70 {
71 std::vector<RawNodeData> nodeData;
72 std::vector<RawWayData> wayData;
73 std::vector<RawRelationData> relationData;
74 };
75
76 // Should be unique_ptr but I get compiler errors if passing it to the WriteWorkerQueue
77 using RawBlockDataRef = std::shared_ptr<RawBlockData>;
78
79 public:
80 virtual ~PreprocessorCallback() = default;
81
82 virtual void ProcessBlock(RawBlockDataRef data) = 0;
83 };
84
86 {
87 public:
88 virtual ~Preprocessor() = default;
89
90 virtual bool Import(const TypeConfigRef& typeConfig,
91 const ImportParameter& parameter,
92 Progress& progress,
93 const std::string& filename) = 0;
94
95 };
96}
97
98#endif
#define OSMSCOUT_IMPORT_API
Definition ImportImportExport.h:45
Definition Preprocessor.h:36
virtual void ProcessBlock(RawBlockDataRef data)=0
std::shared_ptr< RawBlockData > RawBlockDataRef
Definition Preprocessor.h:77
virtual ~PreprocessorCallback()=default
Definition Preprocessor.h:86
virtual ~Preprocessor()=default
virtual bool Import(const TypeConfigRef &typeConfig, const ImportParameter &parameter, Progress &progress, const std::string &filename)=0
Definition Progress.h:34
int64_t OSMId
Definition OSMScoutTypes.h:33
std::shared_ptr< TypeConfig > TypeConfigRef
Definition TypeConfig.h:1396
Definition Area.h:39
std::unordered_map< TagId, std::string > TagMap
Definition Tag.h:41
std::vector< RawRelationData > relationData
Definition Preprocessor.h:73
std::vector< RawWayData > wayData
Definition Preprocessor.h:72
std::vector< RawNodeData > nodeData
Definition Preprocessor.h:71
GeoCoord coord
Definition Preprocessor.h:41
RawNodeData(OSMId id, const GeoCoord &coord)
Definition Preprocessor.h:46
TagMap tags
Definition Preprocessor.h:42
OSMId id
Definition Preprocessor.h:40
OSMId id
Definition Preprocessor.h:64
TagMap tags
Definition Preprocessor.h:65
std::vector< RawRelation::Member > members
Definition Preprocessor.h:66
Definition Preprocessor.h:56
TagMap tags
Definition Preprocessor.h:58
OSMId id
Definition Preprocessor.h:57
std::vector< OSMId > nodes
Definition Preprocessor.h:59