libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
GenMergeAreas.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_IMPORT_GENMERGEAREAS_H
2
#define OSMSCOUT_IMPORT_GENMERGEAREAS_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2013 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 <list>
24
#include <set>
25
#include <unordered_map>
26
#include <unordered_set>
27
28
#include <
osmscout/TypeInfoSet.h
>
29
30
#include <
osmscout/Area.h
>
31
#include <
osmscout/Way.h
>
32
33
#include <osmscoutimport/ImportFeatures.h>
34
#include <
osmscoutimport/Import.h
>
35
36
#include <
osmscout/util/NodeUseMap.h
>
37
38
#include <
osmscout/system/Compiler.h
>
39
40
namespace
osmscout
{
41
45
struct
AreaMergeJob
46
{
47
TypeInfoRef
type
;
48
std::unordered_set<Id>
nodeUseSet
;
49
size_t
areaCount
;
50
std::list<AreaRef>
areas
;
51
};
52
56
struct
AreaMergeResult
57
{
58
TypeInfoRef
type
;
59
std::list<AreaRef>
merges
;
60
std::unordered_set<FileOffset>
mergedAway
;
61
};
62
67
class
MergeAreasGenerator
CLASS_FINAL
:
public
ImportModule
68
{
69
public
:
70
static
const
char
*
const
AREAS2_TMP
;
71
72
private
:
95
void
GetAreas(
const
ImportParameter
& parameter,
96
Progress
& progress,
97
const
TypeConfig
& typeConfig,
98
const
TypeInfoSet
& candidateTypes,
99
TypeInfoSet
& loadedTypes,
100
FileScanner
& scanner,
101
std::vector<AreaMergeJob>& mergeJobs);
102
103
void
WriteMergeResult(
Progress
& progress,
104
const
TypeConfig
& typeConfig,
105
FileScanner
& scanner,
106
FileWriter
& writer,
107
const
TypeInfoSet
& loadedTypes,
108
const
std::vector<AreaMergeResult>& mergeJob,
109
uint32_t& areasWritten);
110
111
public
:
112
void
GetDescription
(
const
ImportParameter
& parameter,
113
ImportModuleDescription& description)
const override
;
114
115
bool
Import
(
const
TypeConfigRef
& typeConfig,
116
const
ImportParameter
& parameter,
117
Progress
& progress)
override
;
118
};
119
}
120
121
#endif
Area.h
Compiler.h
Import.h
NodeUseMap.h
TypeInfoSet.h
Way.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::GetDescription
void GetDescription(const ImportParameter ¶meter, ImportModuleDescription &description) const override
osmscout::CLASS_FINAL::TypeInfoSet
TypeInfoSet()=default
osmscout::CLASS_FINAL::TypeConfig
TypeConfig()
osmscout::CLASS_FINAL::ImportParameter
ImportParameter()
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::AREAS2_TMP
static const char *const AREAS2_TMP
Definition
GenMergeAreas.h:70
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::Import
bool Import(const TypeConfigRef &typeConfig, const ImportParameter ¶meter, Progress &progress) override
osmscout::ImportModule
Definition
ImportModule.h:101
osmscout::Progress::Progress
Progress()
osmscout::TypeConfigRef
std::shared_ptr< TypeConfig > TypeConfigRef
Definition
TypeConfig.h:1396
osmscout
Definition
Area.h:39
osmscout::TypeInfoRef
std::shared_ptr< TypeInfo > TypeInfoRef
Definition
TypeConfig.h:61
osmscout::AreaMergeJob
Definition
GenMergeAreas.h:46
osmscout::AreaMergeJob::areas
std::list< AreaRef > areas
List of areas that are candidates for merging.
Definition
GenMergeAreas.h:50
osmscout::AreaMergeJob::areaCount
size_t areaCount
Number of areas of this type.
Definition
GenMergeAreas.h:49
osmscout::AreaMergeJob::type
TypeInfoRef type
Definition
GenMergeAreas.h:47
osmscout::AreaMergeJob::nodeUseSet
std::unordered_set< Id > nodeUseSet
Definition
GenMergeAreas.h:48
osmscout::AreaMergeResult
Definition
GenMergeAreas.h:57
osmscout::AreaMergeResult::mergedAway
std::unordered_set< FileOffset > mergedAway
List of file offsets of areas, that were merged into another area.
Definition
GenMergeAreas.h:60
osmscout::AreaMergeResult::type
TypeInfoRef type
Definition
GenMergeAreas.h:58
osmscout::AreaMergeResult::merges
std::list< AreaRef > merges
List of areas that got merged.
Definition
GenMergeAreas.h:59
Generated by
1.17.0