2010-10-28 18:57:58 +02:00
|
|
|
option java_package = "net.osmand.binary";
|
|
|
|
//protoc --java_out=../.. osmand_odb.proto
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// STORAGE LAYER: Storing primitives.
|
|
|
|
//
|
|
|
|
|
|
|
|
// IMPORTANT : These messages are not intented to be parsed by google engine (because of the size)
|
|
|
|
// The main difference that size of that messages is not var int and is always fixed int size
|
|
|
|
message OsmAndStructure {
|
|
|
|
required uint32 version = 1;
|
2010-10-28 21:13:05 +02:00
|
|
|
// encoded as fixed32 length delimited
|
2010-11-01 14:54:52 +01:00
|
|
|
repeated OsmAndMapIndex mapIndex = 2;
|
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
repeated OsmAndAddressIndex addressIndex = 3;
|
2010-10-28 18:57:58 +02:00
|
|
|
}
|
|
|
|
|
2010-11-01 14:54:52 +01:00
|
|
|
|
2010-10-28 18:57:58 +02:00
|
|
|
message OsmAndMapIndex {
|
2010-10-28 21:13:05 +02:00
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
repeated MapRootLevel levels = 1;
|
2010-10-28 18:57:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
message MapRootLevel {
|
|
|
|
required int32 maxZoom = 1;
|
|
|
|
required int32 minZoom = 2;
|
|
|
|
required int32 left = 3;
|
|
|
|
required int32 right = 4;
|
|
|
|
required int32 top = 5;
|
|
|
|
required int32 bottom = 6;
|
|
|
|
|
2010-10-28 21:13:05 +02:00
|
|
|
// encoded as fixed32 length delimited
|
2010-10-28 18:57:58 +02:00
|
|
|
repeated MapTree root = 7;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
message MapTree {
|
|
|
|
required sint32 left = 1; // delta encoded
|
|
|
|
required sint32 right = 2; // delta encoded
|
|
|
|
required sint32 top = 3; // delta encoded
|
|
|
|
required sint32 bottom = 4; // delta encoded
|
|
|
|
|
|
|
|
optional StringTable stringTable = 5;
|
|
|
|
optional uint64 baseId = 6;
|
|
|
|
|
2010-10-28 21:13:05 +02:00
|
|
|
// encoded as fixed32 length delimited
|
2010-10-28 18:57:58 +02:00
|
|
|
repeated MapTree subtrees = 7;
|
2010-10-28 21:13:05 +02:00
|
|
|
|
2010-10-28 18:57:58 +02:00
|
|
|
repeated MapData leafs = 8;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// These messages could be read directly
|
|
|
|
/**
|
|
|
|
String table, contains the common strings in each block.
|
|
|
|
*/
|
|
|
|
message StringTable {
|
|
|
|
repeated string s = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// Simple messages
|
|
|
|
message MapData {
|
2010-10-30 11:23:51 +02:00
|
|
|
required bytes coordinates = 1; // array of delta x,y sint32 (CodedIinputStream) >> 5
|
2010-10-28 18:57:58 +02:00
|
|
|
// first x delta to Tree.left, y to delta Tree.top (next delta to previous)
|
|
|
|
required bytes types = 2; // array of fixed int16
|
|
|
|
|
|
|
|
required sint64 id = 3; // delta encoded
|
|
|
|
optional uint32 stringId = 4;
|
|
|
|
|
|
|
|
optional bytes restrictions = 5; // array of SInt64 delta encoded (to baseId !)
|
|
|
|
optional int32 highwayMeta = 6;
|
|
|
|
}
|
|
|
|
|
2010-11-01 14:54:52 +01:00
|
|
|
|
|
|
|
/// ADDRESS INFORMATION TEST -----
|
|
|
|
|
|
|
|
message OsmAndAddressIndex {
|
|
|
|
|
|
|
|
required string name = 1;
|
|
|
|
optional string name_en = 2;
|
|
|
|
|
|
|
|
// encoded as fixed32 length delimited
|
2010-11-02 00:42:17 +01:00
|
|
|
optional CitiesIndex cities = 5; // cities and towns
|
2010-11-01 14:54:52 +01:00
|
|
|
|
2010-11-02 00:42:17 +01:00
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
optional PostcodesIndex postcodes = 6;
|
2010-11-01 14:54:52 +01:00
|
|
|
|
2010-11-02 00:42:17 +01:00
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
optional CitiesIndex villages = 7; // suburbs and villages
|
|
|
|
}
|
|
|
|
|
|
|
|
message CitiesIndex {
|
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
repeated CityIndex cities = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PostcodesIndex {
|
|
|
|
// encoded as fixed32 length delimited
|
|
|
|
repeated PostcodeIndex postcodes = 1;
|
2010-11-01 14:54:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message CityIndex {
|
2010-11-02 13:33:35 +01:00
|
|
|
// should be written the first
|
2010-11-01 14:54:52 +01:00
|
|
|
required uint32 city_type = 1; // 0-5 enum CityType
|
2010-11-02 13:33:35 +01:00
|
|
|
|
2010-11-01 14:54:52 +01:00
|
|
|
required string name = 2;
|
|
|
|
optional string name_en = 3;
|
|
|
|
optional uint64 id = 4;
|
|
|
|
|
|
|
|
required fixed32 x = 5; // x tile of 31 zoom
|
|
|
|
required fixed32 y = 6; // y tile of 31 zoom
|
|
|
|
|
2010-11-02 13:33:35 +01:00
|
|
|
repeated StreetIndex streets = 10;
|
2010-11-01 14:54:52 +01:00
|
|
|
}
|
|
|
|
|
2010-11-02 00:42:17 +01:00
|
|
|
|
|
|
|
|
2010-11-01 14:54:52 +01:00
|
|
|
message PostcodeIndex {
|
|
|
|
required string postcode = 1;
|
|
|
|
repeated StreetIndex streets = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
message StreetIndex {
|
|
|
|
required string name = 1;
|
|
|
|
optional string name_en = 2;
|
|
|
|
|
|
|
|
optional uint64 id = 6;
|
|
|
|
|
|
|
|
required sint32 x = 3; // delta encoded to parent 24 zoom
|
|
|
|
required sint32 y = 4; // delta encoded to parent 24 zoom
|
|
|
|
|
2010-11-02 13:33:35 +01:00
|
|
|
repeated BuildingIndex buildings = 10;
|
2010-11-01 14:54:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
message BuildingIndex {
|
|
|
|
required string name = 1;
|
|
|
|
optional string name_en = 2;
|
|
|
|
optional uint64 id = 5;
|
2010-11-02 00:42:17 +01:00
|
|
|
optional string postcode = 6;
|
2010-11-01 14:54:52 +01:00
|
|
|
|
|
|
|
required sint32 x = 3; // delta encoded to street 24 zoom
|
|
|
|
required sint32 y = 4; // delta encoded to street 24 zoom
|
|
|
|
|
|
|
|
}
|