1syntax = "proto2";  // needed by newer protoc compilers
2// The rest of the file is a verbatim copy of MVT 2.1 proto file:
3// https://github.com/mapbox/vector-tile-spec/blob/master/2.1/vector_tile.proto
4
5package vector_tile;
6
7option optimize_for = LITE_RUNTIME;
8
9message Tile {
10
11        // GeomType is described in section 4.3.4 of the specification
12        enum GeomType {
13             UNKNOWN = 0;
14             POINT = 1;
15             LINESTRING = 2;
16             POLYGON = 3;
17        }
18
19        // Variant type encoding
20        // The use of values is described in section 4.1 of the specification
21        message Value {
22                // Exactly one of these values must be present in a valid message
23                optional string string_value = 1;
24                optional float float_value = 2;
25                optional double double_value = 3;
26                optional int64 int_value = 4;
27                optional uint64 uint_value = 5;
28                optional sint64 sint_value = 6;
29                optional bool bool_value = 7;
30
31                extensions 8 to max;
32        }
33
34        // Features are described in section 4.2 of the specification
35        message Feature {
36                optional uint64 id = 1 [ default = 0 ];
37
38                // Tags of this feature are encoded as repeated pairs of
39                // integers.
40                // A detailed description of tags is located in sections
41                // 4.2 and 4.4 of the specification
42                repeated uint32 tags = 2 [ packed = true ];
43
44                // The type of geometry stored in this feature.
45                optional GeomType type = 3 [ default = UNKNOWN ];
46
47                // Contains a stream of commands and parameters (vertices).
48                // A detailed description on geometry encoding is located in
49                // section 4.3 of the specification.
50                repeated uint32 geometry = 4 [ packed = true ];
51        }
52
53        // Layers are described in section 4.1 of the specification
54        message Layer {
55                // Any compliant implementation must first read the version
56                // number encoded in this message and choose the correct
57                // implementation for this version number before proceeding to
58                // decode other parts of this message.
59                required uint32 version = 15 [ default = 1 ];
60
61                required string name = 1;
62
63                // The actual features in this tile.
64                repeated Feature features = 2;
65
66                // Dictionary encoding for keys
67                repeated string keys = 3;
68
69                // Dictionary encoding for values
70                repeated Value values = 4;
71
72                // Although this is an "optional" field it is required by the specification.
73                // See https://github.com/mapbox/vector-tile-spec/issues/47
74                optional uint32 extent = 5 [ default = 4096 ];
75
76                extensions 16 to max;
77        }
78
79        repeated Layer layers = 3;
80
81        extensions 16 to 8191;
82}
83