1 2syntax = "proto2"; 3 4option optimize_for = LITE_RUNTIME; 5 6message Data { 7 repeated string keys = 1; // global arrays of unique keys 8 9 optional uint32 dimensions = 2 [default = 2]; // max coordinate dimensions 10 optional uint32 precision = 3 [default = 6]; // number of digits after decimal point for coordinates 11 12 oneof data_type { 13 FeatureCollection feature_collection = 4; 14 Feature feature = 5; 15 Geometry geometry = 6; 16 } 17 18 message Feature { 19 required Geometry geometry = 1; 20 21 oneof id_type { 22 string id = 11; 23 sint64 int_id = 12; 24 } 25 26 repeated Value values = 13; // unique values 27 repeated uint32 properties = 14 [packed = true]; // pairs of key/value indexes 28 repeated uint32 custom_properties = 15 [packed = true]; // arbitrary properties 29 } 30 31 message Geometry { 32 required Type type = 1; 33 34 repeated uint32 lengths = 2 [packed = true]; // coordinate structure in lengths 35 repeated sint64 coords = 3 [packed = true]; // delta-encoded integer values 36 repeated Geometry geometries = 4; 37 38 repeated Value values = 13; 39 repeated uint32 custom_properties = 15 [packed = true]; 40 41 enum Type { 42 POINT = 0; 43 MULTIPOINT = 1; 44 LINESTRING = 2; 45 MULTILINESTRING = 3; 46 POLYGON = 4; 47 MULTIPOLYGON = 5; 48 GEOMETRYCOLLECTION = 6; 49 } 50 } 51 52 message FeatureCollection { 53 repeated Feature features = 1; 54 55 repeated Value values = 13; 56 repeated uint32 custom_properties = 15 [packed = true]; 57 } 58 59 message Value { 60 oneof value_type { 61 string string_value = 1; 62 double double_value = 2; 63 uint64 pos_int_value = 3; 64 uint64 neg_int_value = 4; 65 bool bool_value = 5; 66 string json_value = 6; 67 } 68 } 69} 70