libosmscout
1.1.1
Toggle main menu visibility
Loading...
Searching...
No Matches
libosmscout-import
include
osmscoutimport
RawNode.h
Go to the documentation of this file.
1
#ifndef OSMSCOUT_IMPORT_RAWNODE_H
2
#define OSMSCOUT_IMPORT_RAWNODE_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
#include <vector>
26
27
#include <
osmscout/GeoCoord.h
>
28
#include <
osmscout/Tag.h
>
29
#include <
osmscout/TypeConfig.h
>
30
31
#include <
osmscout/io/FileScanner.h
>
32
#include <
osmscout/io/FileWriter.h
>
33
34
#include <
osmscout/system/Compiler.h
>
35
36
namespace
osmscout
{
37
38
class
RawNode
CLASS_FINAL
39
{
40
private
:
41
OSMId
id;
42
GeoCoord coord;
43
FeatureValueBuffer featureValueBuffer;
44
45
private
:
46
public
:
47
RawNode
();
48
49
inline
OSMId
GetId
()
const
50
{
51
return
id
;
52
}
53
54
inline
TypeInfoRef
GetType
()
const
55
{
56
return
featureValueBuffer.GetType();
57
}
58
59
inline
const
GeoCoord
&
GetCoords
()
const
60
{
61
return
coord
;
62
}
63
64
inline
double
GetLat
()
const
65
{
66
return
coord
.GetLat();
67
}
68
69
inline
double
GetLon
()
const
70
{
71
return
coord
.GetLon();
72
}
73
74
inline
size_t
GetFeatureCount
()
const
75
{
76
return
featureValueBuffer.GetType()->GetFeatureCount();
77
}
78
79
inline
bool
HasFeature
(
size_t
idx)
const
80
{
81
return
featureValueBuffer.HasFeature(idx);
82
}
83
84
inline
const
FeatureInstance
&
GetFeature
(
size_t
idx)
const
85
{
86
return
featureValueBuffer.GetType()->GetFeature(idx);
87
}
88
89
inline
FeatureValue
*
GetFeatureValue
(
size_t
idx)
const
90
{
91
return
featureValueBuffer.GetValue(idx);
92
}
93
94
inline
const
FeatureValueBuffer
&
GetFeatureValueBuffer
()
const
95
{
96
return
featureValueBuffer;
97
}
98
99
inline
bool
IsIdentical
(
const
RawNode
& other)
const
100
{
101
return
id
==other.id;
102
}
103
104
inline
bool
IsSame
(
const
RawNode
& other)
const
105
{
106
return
coord
==other.coord;
107
}
108
109
inline
bool
IsEqual
(
const
RawNode
& other)
const
110
{
111
return
id
==other.id ||
coord
==other.coord;
112
}
113
114
void
SetId
(
OSMId
id
);
115
void
SetType
(
const
TypeInfoRef
&
type
);
116
117
void
SetCoord
(
const
GeoCoord
&
coord
);
118
119
void
UnsetFeature
(
size_t
idx);
120
121
void
Parse
(
TagErrorReporter
& errorReporter,
122
const
TagRegistry
& tagRegistry,
123
const
TagMap
& tags);
124
void
Read
(
const
TypeConfig
& typeConfig,
125
FileScanner
& scanner);
126
void
Write
(
const
TypeConfig
& typeConfig,
127
FileWriter
& writer)
const
;
128
};
129
130
typedef
std::shared_ptr<RawNode>
RawNodeRef
;
131
}
132
133
#endif
Compiler.h
FileScanner.h
FileWriter.h
GeoCoord.h
Tag.h
TypeConfig.h
osmscout::CLASS_FINAL
Definition
Area.h:88
osmscout::CLASS_FINAL::UnsetFeature
void UnsetFeature(size_t idx)
osmscout::CLASS_FINAL::GetType
TypeInfoRef GetType() const
Definition
RawNode.h:54
osmscout::CLASS_FINAL::coord
const GeoCoord coord
Definition
RouteStateAgent.h:49
osmscout::CLASS_FINAL::GetId
OSMId GetId() const
Definition
RawNode.h:49
osmscout::CLASS_FINAL::SetCoord
void SetCoord(const GeoCoord &coord)
osmscout::CLASS_FINAL::TypeConfig
TypeConfig()
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
RawNode.h:79
osmscout::CLASS_FINAL::GetFeatureValue
FeatureValue * GetFeatureValue(size_t idx) const
Definition
RawNode.h:89
osmscout::CLASS_FINAL::GetCoords
const GeoCoord & GetCoords() const
Definition
RawNode.h:59
osmscout::CLASS_FINAL::GetLat
double GetLat() const
Definition
RawNode.h:64
osmscout::CLASS_FINAL::FeatureInstance
FeatureInstance()
osmscout::CLASS_FINAL::id
OSMId id
We are an area.
Definition
ObjectRef.h:49
osmscout::CLASS_FINAL::GeoCoord
GeoCoord()=default
osmscout::CLASS_FINAL::FileScanner
FileScanner()=default
osmscout::CLASS_FINAL::FileWriter
FileWriter()=default
osmscout::CLASS_FINAL::GetLon
double GetLon() const
Definition
RawNode.h:69
osmscout::CLASS_FINAL::IsIdentical
bool IsIdentical(const RawNode &other) const
Definition
RawNode.h:99
osmscout::CLASS_FINAL::GetFeatureValueBuffer
const FeatureValueBuffer & GetFeatureValueBuffer() const
Definition
RawNode.h:94
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::IsEqual
bool IsEqual(const RawNode &other) const
Definition
RawNode.h:109
osmscout::CLASS_FINAL::SetType
void SetType(const TypeInfoRef &type)
osmscout::CLASS_FINAL::IsSame
bool IsSame(const RawNode &other) const
Definition
RawNode.h:104
osmscout::CLASS_FINAL::TagRegistry
TagRegistry()
osmscout::CLASS_FINAL::FeatureValueBuffer
FeatureValueBuffer()=default
osmscout::CLASS_FINAL::GetFeature
const FeatureInstance & GetFeature(size_t idx) const
Definition
RawNode.h:84
osmscout::CLASS_FINAL::Read
void Read(const TypeConfig &typeConfig, FileScanner &scanner)
osmscout::CLASS_FINAL::RawNode
RawNode()
osmscout::CLASS_FINAL::GetFeatureCount
size_t GetFeatureCount() const
Definition
RawNode.h:74
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::RawNodeRef
std::shared_ptr< RawNode > RawNodeRef
Definition
RawNode.h:130
osmscout::TagMap
std::unordered_map< TagId, std::string > TagMap
Definition
Tag.h:41
osmscout::TypeInfoRef
std::shared_ptr< TypeInfo > TypeInfoRef
Definition
TypeConfig.h:61
Generated by
1.17.0