libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
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
>
27
#include <
osmscout/OSMScoutTypes.h
>
28
#include <
osmscout/util/Progress.h
>
29
30
#include <
osmscoutimport/Import.h
>
31
#include <
osmscoutimport/RawRelation.h
>
32
33
namespace
osmscout
{
34
35
class
OSMSCOUT_IMPORT_API
PreprocessorCallback
36
{
37
public
:
38
struct
RawNodeData
39
{
40
OSMId
id
;
41
GeoCoord
coord
;
42
TagMap
tags
;
43
44
RawNodeData
() =
default
;
45
46
RawNodeData
(
OSMId
id
,
47
const
GeoCoord&
coord
)
48
:
id
(
id
),
49
coord
(
coord
)
50
{
51
// no code
52
}
53
};
54
55
struct
RawWayData
56
{
57
OSMId
id
;
58
TagMap
tags
;
59
std::vector<OSMId>
nodes
;
60
};
61
62
struct
RawRelationData
63
{
64
OSMId
id
;
65
TagMap
tags
;
66
std::vector<RawRelation::Member>
members
;
67
};
68
69
struct
RawBlockData
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
85
class
OSMSCOUT_IMPORT_API
Preprocessor
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
Import.h
OSMSCOUT_IMPORT_API
#define OSMSCOUT_IMPORT_API
Definition
ImportImportExport.h:45
OSMScoutTypes.h
Progress.h
RawRelation.h
Tag.h
TypeConfig.h
osmscout::PreprocessorCallback
Definition
Preprocessor.h:36
osmscout::PreprocessorCallback::ProcessBlock
virtual void ProcessBlock(RawBlockDataRef data)=0
osmscout::PreprocessorCallback::RawBlockDataRef
std::shared_ptr< RawBlockData > RawBlockDataRef
Definition
Preprocessor.h:77
osmscout::PreprocessorCallback::~PreprocessorCallback
virtual ~PreprocessorCallback()=default
osmscout::Preprocessor
Definition
Preprocessor.h:86
osmscout::Preprocessor::~Preprocessor
virtual ~Preprocessor()=default
osmscout::Preprocessor::Import
virtual bool Import(const TypeConfigRef &typeConfig, const ImportParameter ¶meter, Progress &progress, const std::string &filename)=0
osmscout::Progress
Definition
Progress.h:34
osmscout::OSMId
int64_t OSMId
Definition
OSMScoutTypes.h:33
osmscout::TypeConfigRef
std::shared_ptr< TypeConfig > TypeConfigRef
Definition
TypeConfig.h:1396
osmscout
Definition
Area.h:39
osmscout::TagMap
std::unordered_map< TagId, std::string > TagMap
Definition
Tag.h:41
osmscout::PreprocessorCallback::RawBlockData
Definition
Preprocessor.h:70
osmscout::PreprocessorCallback::RawBlockData::relationData
std::vector< RawRelationData > relationData
Definition
Preprocessor.h:73
osmscout::PreprocessorCallback::RawBlockData::wayData
std::vector< RawWayData > wayData
Definition
Preprocessor.h:72
osmscout::PreprocessorCallback::RawBlockData::nodeData
std::vector< RawNodeData > nodeData
Definition
Preprocessor.h:71
osmscout::PreprocessorCallback::RawNodeData::coord
GeoCoord coord
Definition
Preprocessor.h:41
osmscout::PreprocessorCallback::RawNodeData::RawNodeData
RawNodeData(OSMId id, const GeoCoord &coord)
Definition
Preprocessor.h:46
osmscout::PreprocessorCallback::RawNodeData::tags
TagMap tags
Definition
Preprocessor.h:42
osmscout::PreprocessorCallback::RawNodeData::id
OSMId id
Definition
Preprocessor.h:40
osmscout::PreprocessorCallback::RawNodeData::RawNodeData
RawNodeData()=default
osmscout::PreprocessorCallback::RawRelationData
Definition
Preprocessor.h:63
osmscout::PreprocessorCallback::RawRelationData::id
OSMId id
Definition
Preprocessor.h:64
osmscout::PreprocessorCallback::RawRelationData::tags
TagMap tags
Definition
Preprocessor.h:65
osmscout::PreprocessorCallback::RawRelationData::members
std::vector< RawRelation::Member > members
Definition
Preprocessor.h:66
osmscout::PreprocessorCallback::RawWayData
Definition
Preprocessor.h:56
osmscout::PreprocessorCallback::RawWayData::tags
TagMap tags
Definition
Preprocessor.h:58
osmscout::PreprocessorCallback::RawWayData::id
OSMId id
Definition
Preprocessor.h:57
osmscout::PreprocessorCallback::RawWayData::nodes
std::vector< OSMId > nodes
Definition
Preprocessor.h:59
Generated by
1.17.0