libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
RawWay.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_IMPORT_RAWWAY_H
2
#define OSMSCOUT_IMPORT_RAWWAY_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/system/Compiler.h
>
33
34
namespace
osmscout
{
35
36
class
RawWay
CLASS_FINAL
37
{
38
private
:
39
OSMId
id
=0;
40
bool
isArea=
false
;
41
std::vector<OSMId> nodes;
42
FeatureValueBuffer featureValueBuffer;
43
44
public
:
45
RawWay
() =
default
;
46
47
inline
OSMId
GetId
()
const
48
{
49
return
id
;
50
}
51
52
inline
bool
IsArea
()
const
53
{
54
return
isArea;
55
}
56
57
inline
TypeInfoRef
GetType
()
const
58
{
59
return
featureValueBuffer.GetType();
60
}
61
62
inline
const
std::vector<OSMId>&
GetNodes
()
const
63
{
64
return
nodes
;
65
}
66
67
inline
size_t
GetNodeCount
()
const
68
{
69
return
nodes
.size();
70
}
71
72
inline
OSMId
GetNodeId
(
size_t
idx)
const
73
{
74
return
nodes
[idx];
75
}
76
77
inline
OSMId
GetFirstNodeId
()
const
78
{
79
return
nodes
[0];
80
}
81
82
inline
OSMId
GetLastNodeId
()
const
83
{
84
return
nodes
[
nodes
.size()-1];
85
}
86
87
inline
size_t
GetFeatureCount
()
const
88
{
89
return
featureValueBuffer.GetType()->GetFeatureCount();
90
}
91
92
inline
bool
HasFeature
(
size_t
idx)
const
93
{
94
return
featureValueBuffer.HasFeature(idx);
95
}
96
97
inline
const
FeatureInstance
&
GetFeature
(
size_t
idx)
const
98
{
99
return
featureValueBuffer.GetType()->GetFeature(idx);
100
}
101
102
inline
FeatureValue
*
GetFeatureValue
(
size_t
idx)
const
103
{
104
return
featureValueBuffer.GetValue(idx);
105
}
106
107
inline
const
FeatureValueBuffer
&
GetFeatureValueBuffer
()
const
108
{
109
return
featureValueBuffer;
110
}
111
112
inline
void
SetFeatureValueBuffer
(
const
FeatureValueBuffer
& other)
113
{
114
featureValueBuffer.Set(other);
115
}
116
117
bool
IsOneway
()
const
;
118
119
void
SetId
(
OSMId
id
);
120
void
SetType
(
const
TypeInfoRef
&
type
,
121
bool
area);
122
void
SetNodes
(
const
std::vector<OSMId>&
nodes
);
123
124
template
<
typename
Iterator>
125
void
SetNodes
(Iterator first, Iterator end)
126
{
127
nodes
.assign(first,end);
128
}
129
130
void
Parse
(
TagErrorReporter
& errorReporter,
131
const
TagRegistry
& tagRegistry,
132
const
TagMap
& tags);
133
void
Read
(
const
TypeConfig
& typeConfig,
134
FileScanner
& scanner);
135
void
Write
(
const
TypeConfig
& typeConfig,
136
FileWriter
& writer)
const
;
137
};
138
139
using
RawWayRef
= std::shared_ptr<RawWay>;
140
}
141
142
#endif
Compiler.h
FileScanner.h
FileWriter.h
Tag.h
TypeConfig.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::GetFirstNodeId
OSMId GetFirstNodeId() const
Definition
RawWay.h:77
osmscout::CLASS_FINAL::SetNodes
void SetNodes(const std::vector< OSMId > &nodes)
osmscout::CLASS_FINAL::GetType
TypeInfoRef GetType() const
Definition
RawWay.h:57
osmscout::CLASS_FINAL::nodes
std::vector< Point > nodes
List of nodes.
Definition
Way.h:57
osmscout::CLASS_FINAL::GetNodeCount
size_t GetNodeCount() const
Definition
RawWay.h:67
osmscout::CLASS_FINAL::GetId
OSMId GetId() const
Definition
RawWay.h:47
osmscout::CLASS_FINAL::TypeConfig
TypeConfig()
osmscout::CLASS_FINAL::SetNodes
void SetNodes(Iterator first, Iterator end)
Definition
RawWay.h:125
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
RawWay.h:92
osmscout::CLASS_FINAL::GetFeatureValue
FeatureValue * GetFeatureValue(size_t idx) const
Definition
RawWay.h:102
osmscout::CLASS_FINAL::GetNodeId
OSMId GetNodeId(size_t idx) const
Definition
RawWay.h:72
osmscout::CLASS_FINAL::RawWay
RawWay()=default
osmscout::CLASS_FINAL::FeatureInstance
FeatureInstance()
osmscout::CLASS_FINAL::id
OSMId id
We are an area.
Definition
ObjectRef.h:49
osmscout::CLASS_FINAL::IsArea
bool IsArea() const
Definition
RawWay.h:52
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::GetNodes
const std::vector< OSMId > & GetNodes() const
Definition
RawWay.h:62
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::SetType
void SetType(const TypeInfoRef &type, bool area)
osmscout::CLASS_FINAL::GetFeatureValueBuffer
const FeatureValueBuffer & GetFeatureValueBuffer() const
Definition
RawWay.h:107
osmscout::CLASS_FINAL::type
Type type
The type of the cell.
Definition
GroundTile.h:92
osmscout::CLASS_FINAL::SetFeatureValueBuffer
void SetFeatureValueBuffer(const FeatureValueBuffer &other)
Definition
RawWay.h:112
osmscout::CLASS_FINAL::SetId
void SetId(OSMId id)
osmscout::CLASS_FINAL::TagRegistry
TagRegistry()
osmscout::CLASS_FINAL::IsOneway
bool IsOneway() const
osmscout::CLASS_FINAL::FeatureValueBuffer
FeatureValueBuffer()=default
osmscout::CLASS_FINAL::GetFeature
const FeatureInstance & GetFeature(size_t idx) const
Definition
RawWay.h:97
osmscout::CLASS_FINAL::Read
void Read(const TypeConfig &typeConfig, FileScanner &scanner)
osmscout::CLASS_FINAL::GetFeatureCount
size_t GetFeatureCount() const
Definition
RawWay.h:87
osmscout::CLASS_FINAL::GetLastNodeId
OSMId GetLastNodeId() const
Definition
RawWay.h:82
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::RawWayRef
std::shared_ptr< RawWay > RawWayRef
Definition
RawWay.h:139
osmscout::TypeInfoRef
std::shared_ptr< TypeInfo > TypeInfoRef
Definition
TypeConfig.h:61
Generated by
1.17.0