-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvector_tile.proto
More file actions
executable file
·202 lines (188 loc) · 6.59 KB
/
vector_tile.proto
File metadata and controls
executable file
·202 lines (188 loc) · 6.59 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
package open_vector_tile;
option optimize_for = LITE_RUNTIME;
// This is a modified version of the Mapbox Vector Tile specification
// To show how the two specifications coexist, we're using the same
// protobuffer definition.
message Tile {
// GeomType is described in section 4.3.4 of the specification
enum GeomType {
// should never be used.
UNKNOWN = 0;
// can be a point or a multipoint
POINT = 1;
// can be a line or a multilinestring
LINESTRING = 2;
// can be a polygon or a multipolygon
POLYGON = 3;
}
// Variant type encoding
// The use of values is described in section 4.1 of the specification
message Value {
// Exactly one of these values must be present in a valid message
optional string string_value = 1;
optional float float_value = 2;
optional double double_value = 3;
optional int64 int_value = 4;
optional uint64 uint_value = 5;
optional sint64 sint_value = 6;
optional bool bool_value = 7;
// potential extensions
extensions 8 to max;
}
// Features are described in section 4.2 of the specification
message MapboxFeature {
optional uint64 id = 1 [ default = 0 ];
// Tags of this feature are encoded as repeated pairs of
// integers.
// A detailed description of tags is located in sections
// 4.2 and 4.4 of the specification
repeated uint32 tags = 2 [ packed = true ];
// The type of geometry stored in this feature.
optional GeomType type = 3 [ default = UNKNOWN ];
// Contains a stream of commands and parameters (vertices).
// A detailed description on geometry encoding is located in
// section 4.3 of the specification.
repeated uint32 geometry = 4 [ packed = true ];
}
// Features are described in section 4.2 of the specification
message OpenFlatFeature {
optional uint64 id = 15 [ default = 0 ];
// Tags of this feature are encoded as repeated pairs of
// integers.
// A detailed description of tags is located in sections
// 4.2 and 4.4 of the specification
repeated uint32 tags = 1 [ packed = true ];
// The type of geometry stored in this feature.
optional GeomType type = 2 [ default = UNKNOWN ];
// Contains a stream of commands and parameters (vertices).
// A detailed description on geometry encoding is located in
// section 4.3 of the specification.
repeated uint32 geometry = 3 [ packed = true ];
//
repeated uint32 indices = 4 [ packed = true ];
//
repeated uint32 tessellation = 5 [ packed = true ];
}
// Layers are described in section 4.1 of the mapbox specification
message MapboxLayer {
// Any compliant implementation must first read the version
// number encoded in this message and choose the correct
// implementation for this version number before proceeding to
// decode other parts of this message.
required uint32 version = 15 [ default = 1 ];
// The name of the layer
required string name = 1;
// The actual features in this tile.
repeated MapboxFeature features = 2;
// Dictionary encoding for keys
repeated string keys = 3;
// Dictionary encoding for values
repeated Value values = 4;
// The extent of the layer
required uint32 extent = 5;
// potential extensions
extensions 16 to max;
}
// Layers are described in section 4.1 of the specification
// See https://github.com/mapbox/vector-tile-spec
message OpenFlatLayer {
// Any compliant implementation must first read the version
// number encoded in this message and choose the correct
// implementation for this version number before proceeding to
// decode other parts of this message.
required uint32 version = 15 [ default = 1 ];
// The name of the layer
required string name = 1;
// The actual features in this tile.
repeated OpenFlatFeature features = 2;
// Dictionary encoding for keys
repeated string keys = 3;
// Dictionary encoding for values
repeated Value values = 4;
// Although this is an "optional" field it is required by the specification.
// See https://github.com/mapbox/vector-tile-spec/issues/47
optional uint32 extent = 5 [ default = 4096 ];
// potential extensions
extensions 16 to max;
}
// See #43-vector-layer
message OpenLayer {
required uint32 version = 1;
// The index pointing to the where in the column cache's "string" column
// the name of the layer is stored
required uint32 name = 2;
// The encoded extent. MUST be one of 512, 1024, 2048, 4096, or 8192.
// These are encoded as 0, 1, 2, 3, 4 respectively.
required uint32 extent = 3;
// TODO: Get the correct section.
// encoded features. Learn how to read features in section 4.2
repeated bytes feature = 4;
// potential extensions
extensions 16 to max;
}
message ColumnCache {
repeated string string = 1;
repeated uint64 u64 = 2;
repeated int64 i64 = 3;
repeated float f32 = 4;
// 64-bit relative numbers
repeated double f64 = 5;
// points: encoded Point[]
repeated bytes points = 6;
// points3D: encoded Point3D[]
repeated bytes points3D = 7;
// indices: encoded uint32[]
repeated bytes indices = 8;
// shapes: encoded uint32[]
repeated bytes shapes = 9;
// bbox: encoded BBOX or BBOX3D
repeated bytes bbox = 10;
// potential extensions
extensions 16 to max;
}
// See 4.6 Grid Layer #46-grid-layer in the spec
message GridLayer {
// The extent of the layer
required uint32 extent = 1;
required uint32 size = 2;
required float min = 3;
required float max = 4;
repeated bytes data = 5;
required string name = 6;
}
// GeomType is described in section 4.3.4 of the specification
enum ImageType {
PNG = 0;
JPG = 1;
WEBP = 2;
GIF = 3;
AVIF = 4;
SVG = 5;
BMP = 6;
RAW = 7;
OTHER = 8;
}
// See 4.7 Image Layer (#47-image-layer) in the spec
message ImageLayer {
// enum representing the image type
required ImageType type = 1;
required uint32 width = 2;
required uint32 height = 3;
required bytes image = 4;
required string name = 5;
}
// The Open S2 Flat Tile Specification
repeated OpenFlatLayer open_flat_layers = 1;
// The Mapbox Vector Tile Specification
repeated MapboxLayer mapbox_layers = 3;
// The Open Vector Tile Specification
repeated OpenLayer open_layers = 4;
// Note: required if using the Open Vector Tile Specification
optional ColumnCache column_cache = 5;
// Grided data
repeated GridLayer grids = 6;
// Image data
repeated ImageLayer images = 7;
// potential extensions
extensions 16 to 8191;
}