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 Feature { 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 ]; } // Layers are described in section 4.1 of the 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 Feature 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; } 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 = 0; repeated uint64 u64 = 1; repeated int64 i64 = 2; repeated float f32 = 3; // 64-bit relative numbers repeated double f64 = 4; // points: encoded Point[] repeated bytes points = 5; // points3D: encoded Point3D[] repeated bytes points3D = 6; // indices: encoded uint32[] repeated bytes indices = 7; // shapes: encoded uint32[] repeated bytes shapes = 8; // bbox: encoded BBOX or BBOX3D repeated bytes bbox = 9; // potential extensions extensions 16 to max; } // The Mapbox Vector Tile Specification repeated MapboxLayer layers = 3; // The Open Vector Tile Specification repeated OpenLayer layers = 4; // Note: required if using the Open Vector Tile Specification optional ColumnCache column_cache = 5; // potential extensions extensions 16 to 8191; }