libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
RawRelation.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_IMPORT_RAWRELATION_H
2
#define OSMSCOUT_IMPORT_RAWRELATION_H
3
4
/*
5
This source is part of the libosmscout library
6
Copyright (C) 2009 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 <memory>
24
#include <unordered_map>
25
26
#include <
osmscout/Tag.h
>
27
#include <
osmscout/TypeConfig.h
>
28
29
#include <
osmscout/io/FileScanner.h
>
30
#include <
osmscout/io/FileWriter.h
>
31
32
#include <
osmscout/util/TagErrorReporter.h
>
33
34
#include <
osmscout/system/Compiler.h
>
35
36
namespace
osmscout
{
37
38
class
RawRelation
CLASS_FINAL
39
{
40
public
:
41
enum
MemberType
{
42
memberNode
= 0,
43
memberWay
= 1,
44
memberRelation
= 2
45
};
46
47
struct
Member
48
{
49
MemberType
type
;
50
OSMId
id
;
51
std::string
role
;
52
53
ObjectOSMRef
GetObjectOSMRef
()
const
;
54
};
55
56
private
:
57
OSMId
id
=0;
58
FeatureValueBuffer
featureValueBuffer;
59
60
public
:
61
std::vector<Member> members;
62
63
public
:
64
RawRelation
() =
default
;
65
66
inline
OSMId
GetId
()
const
67
{
68
return
id
;
69
}
70
71
inline
TypeInfoRef
GetType
()
const
72
{
73
return
featureValueBuffer.GetType();
74
}
75
76
inline
size_t
GetFeatureCount
()
const
77
{
78
return
featureValueBuffer.GetType()->GetFeatureCount();
79
}
80
81
inline
bool
HasFeature
(
size_t
idx)
const
82
{
83
return
featureValueBuffer.HasFeature(idx);
84
}
85
86
inline
const
FeatureInstance
&
GetFeature
(
size_t
idx)
const
87
{
88
return
featureValueBuffer.GetType()->GetFeature(idx);
89
}
90
91
inline
FeatureValue
*
GetFeatureValue
(
size_t
idx)
const
92
{
93
return
featureValueBuffer.GetValue(idx);
94
}
95
96
inline
const
FeatureValueBuffer
&
GetFeatureValueBuffer
()
const
97
{
98
return
featureValueBuffer;
99
}
100
101
void
SetId
(
OSMId
id
);
102
void
SetType
(
const
TypeInfoRef
&
type
);
103
104
void
Parse
(
TagErrorReporter
& errorReporter,
105
const
TagRegistry
& tagRegistry,
106
const
TagMap
& tags);
107
void
Read
(
const
TypeConfig
& typeConfig,
108
FileScanner
& scanner);
109
void
Write
(
const
TypeConfig
& typeConfig,
110
FileWriter
& writer)
const
;
111
};
112
113
using
RawRelationRef
= std::shared_ptr<RawRelation>;
114
}
115
116
#endif
Compiler.h
FileScanner.h
FileWriter.h
Tag.h
TagErrorReporter.h
TypeConfig.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::MemberType
MemberType
Definition
RawRelation.h:41
osmscout::CLASS_FINAL::memberRelation
@ memberRelation
Definition
RawRelation.h:44
osmscout::CLASS_FINAL::memberWay
@ memberWay
Definition
RawRelation.h:43
osmscout::CLASS_FINAL::memberNode
@ memberNode
Definition
RawRelation.h:42
osmscout::CLASS_FINAL::GetType
TypeInfoRef GetType() const
Definition
RawRelation.h:71
osmscout::CLASS_FINAL::GetId
OSMId GetId() const
Definition
RawRelation.h:66
osmscout::CLASS_FINAL::RawRelation
RawRelation()=default
osmscout::CLASS_FINAL::TypeConfig
TypeConfig()
osmscout::CLASS_FINAL::ObjectOSMRef
ObjectOSMRef()=default
osmscout::CLASS_FINAL::Parse
void Parse(TagErrorReporter &errorReporter, const TagRegistry &tagRegistry, const TagMap &tags)
osmscout::CLASS_FINAL::Write
void Write(const TypeConfig &typeConfig, FileWriter &writer) const
osmscout::CLASS_FINAL::HasFeature
bool HasFeature(size_t idx) const
Definition
RawRelation.h:81
osmscout::CLASS_FINAL::GetFeatureValue
FeatureValue * GetFeatureValue(size_t idx) const
Definition
RawRelation.h:91
osmscout::CLASS_FINAL::FeatureInstance
FeatureInstance()
osmscout::CLASS_FINAL::id
OSMId id
We are an area.
Definition
ObjectRef.h:49
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::GetFeatureValueBuffer
const FeatureValueBuffer & GetFeatureValueBuffer() const
Definition
RawRelation.h:96
osmscout::CLASS_FINAL::type
Type type
The type of the cell.
Definition
GroundTile.h:92
osmscout::CLASS_FINAL::SetId
void SetId(OSMId id)
osmscout::CLASS_FINAL::SetType
void SetType(const TypeInfoRef &type)
osmscout::CLASS_FINAL::TagRegistry
TagRegistry()
osmscout::CLASS_FINAL::FeatureValueBuffer
FeatureValueBuffer()=default
osmscout::CLASS_FINAL::GetFeature
const FeatureInstance & GetFeature(size_t idx) const
Definition
RawRelation.h:86
osmscout::CLASS_FINAL::Read
void Read(const TypeConfig &typeConfig, FileScanner &scanner)
osmscout::CLASS_FINAL::GetFeatureCount
size_t GetFeatureCount() const
Definition
RawRelation.h:76
osmscout::FeatureValue
Definition
TypeFeature.h:41
osmscout::TagErrorReporter::TagErrorReporter
TagErrorReporter()
osmscout::OSMId
int64_t OSMId
Definition
OSMScoutTypes.h:33
osmscout
Definition
Area.h:39
osmscout::TagMap
std::unordered_map< TagId, std::string > TagMap
Definition
Tag.h:41
osmscout::RawRelationRef
std::shared_ptr< RawRelation > RawRelationRef
Definition
RawRelation.h:113
osmscout::TypeInfoRef
std::shared_ptr< TypeInfo > TypeInfoRef
Definition
TypeConfig.h:61
osmscout::CLASS_FINAL::Member
Definition
RawRelation.h:48
osmscout::CLASS_FINAL::Member::type
MemberType type
Definition
RawRelation.h:49
osmscout::CLASS_FINAL::Member::id
OSMId id
Definition
RawRelation.h:50
osmscout::CLASS_FINAL::Member::role
std::string role
Definition
RawRelation.h:51
osmscout::CLASS_FINAL::Member::GetObjectOSMRef
ObjectOSMRef GetObjectOSMRef() const
Generated by
1.17.0