libosmscout 1.1.1
Loading...
Searching...
No Matches
GenWayAreaDat.h
Go to the documentation of this file.
1#ifndef OSMSCOUT_IMPORT_GENWAYAREADAT_H
2#define OSMSCOUT_IMPORT_GENWAYAREADAT_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 <osmscoutimport/ImportFeatures.h>
24
25#include <tuple>
26#include <unordered_set>
27
28#include <osmscout/Area.h>
29
31
33
35
38
40
41namespace osmscout {
42
43 class WayAreaDataGenerator CLASS_FINAL : public ImportModule
44 {
45 public:
46 static const char* WAYAREA_TMP;
47
48 private:
49 struct Distribution
50 {
51 uint32_t nodeCount;
52 uint32_t wayCount;
53 uint32_t areaCount;
54
55 Distribution();
56 };
57
58 using BlacklistSet = std::unordered_set<OSMId>;
59 using WayList = std::list<RawWayRef>;
60
61 std::tuple<BlacklistSet,bool> ReadWayBlacklist(const ImportParameter& parameter,
62 Progress& progress) const;
63
64 void WriteArea(const ImportParameter& parameter,
65 Progress& progress,
66 const TypeConfig& typeConfig,
67 FileWriter& writer,
68 uint32_t& writtenWayCount,
69 const CoordDataFile::ResultMap& coordsMap,
70 const RawWay& rawWay);
71
72 public:
73 void GetDescription(const ImportParameter& parameter,
74 ImportModuleDescription& description) const override;
75
76 bool Import(const TypeConfigRef& typeConfig,
77 const ImportParameter& parameter,
78 Progress& progress) override;
79 };
80}
81
82#endif
Definition Area.h:88
void GetDescription(const ImportParameter &parameter, ImportModuleDescription &description) const override
bool Import(const TypeConfigRef &typeConfig, const ImportParameter &parameter, Progress &progress) override
static const char * WAYAREA_TMP
Definition GenWayAreaDat.h:46
std::unordered_map< OSMId, Point > ResultMap
Definition CoordDataFile.h:42
Definition ImportModule.h:101
Definition Progress.h:34
std::shared_ptr< TypeConfig > TypeConfigRef
Definition TypeConfig.h:1396
Definition Area.h:39