FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
tilemaker/src/output_object.cpp at master · cyclemap/tilemaker · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
cyclemap
/
tilemaker
Public
forked from
systemed/tilemaker
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
tilemaker
/
src
/
output_object.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
79 lines (68 loc) · 1.95 KB
Breadcrumbs
tilemaker
/
src
/
output_object.cpp
Copy path
File metadata and controls
79 lines (68 loc) · 1.95 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
OutputObject - any object (node, linestring, polygon) to be outputted to tiles
*/
#
include
"
output_object.h
"
#
include
"
helpers.h
"
#
include
"
coordinates_geom.h
"
#
include
<
iostream
>
using
namespace
std
;
namespace
geom
=
boost::geometry;
//
**********************************************************
std::ostream&
operator
<<(std::ostream& os, OutputGeometryType geomType)
{
switch
(geomType) {
case
POINT_
:
os <<
"
POINT
"
;
break
;
case
LINESTRING_
:
os <<
"
LINESTRING
"
;
break
;
case
MULTILINESTRING_
:
os <<
"
MULTILINESTRING
"
;
break
;
case
POLYGON_
:
os <<
"
POLYGON
"
;
break
;
}
return
os;
}
void
OutputObject::writeAttributes
(
const
AttributeStore& attributeStore,
vtzero::feature_builder& fbuilder,
char
zoom
)
const
{
auto
attr = attributeStore.
getUnsafe
(attributes);
for
(
auto
const
&it: attr) {
if
(it->
minzoom
> zoom)
continue
;
//
TODO: consider taking a data view that is stable
//
Look for key
const
std::string& key = attributeStore.
keyStore
.
getKeyUnsafe
(it->
keyIndex
);
if
(it->
hasStringValue
()) {
fbuilder.
add_property
(key, it->
stringValue
());
}
else
if
(it->
hasBoolValue
()) {
fbuilder.
add_property
(key, it->
boolValue
());
}
else
if
(it->
hasIntValue
()) {
//
could potentially add ,vtzero::sint_value_type(2) to force sint encoding (efficient for -ve ints)
fbuilder.
add_property
(key, it->
intValue
());
}
else
if
(it->
hasFloatValue
()) {
fbuilder.
add_property
(key, it->
floatValue
());
}
}
}
bool
OutputObject::compatible
(
const
OutputObject &other) {
return
geomType == other.
geomType
&&
z_order == other.
z_order
&&
attributes == other.
attributes
;
}
//
Comparision functions
bool
operator
==(
const
OutputObject& x,
const
OutputObject& y) {
return
x.
layer
== y.
layer
&&
x.
z_order
== y.
z_order
&&
x.
geomType
== y.
geomType
&&
x.
attributes
== y.
attributes
&&
x.
objectID
== y.
objectID
;
}
bool
operator
==(
const
OutputObjectID& x,
const
OutputObjectID& y) {
return
x.
oo
== y.
oo
&& x.
id
== y.
id
;
}
Back
|
FazBrowse Home
|
New Git URL