package NReverseGeocoder.NOpenStreetMap.NProto;

message TBlob {
    optional bytes Raw = 1;
    optional int32 RawSize = 2;
    optional bytes ZlibData = 3;
    optional bytes LzmaData = 4;
}

message TBlobHeader {
    required string Type = 1;
    optional bytes IndexData = 2;
    required int32 DataSize = 3;
}

message TStringTable {
    repeated bytes S = 1;
}

message TBasicGroup {
    repeated TNode Nodes = 1;
    optional TDenseNodes DenseNodes = 2;
    repeated TWay Ways = 3;
    repeated TRelation Relations = 4;
}

message TBasicBlock {
    required TStringTable StringTable = 1;
    repeated TBasicGroup BasicGroups = 2;
    optional int32 Granularity = 17 [default = 100];
    optional int64 LatOff = 19 [default = 0];
    optional int64 LonOff = 20 [default = 0];
}

message TNode {
    required sint64 Id = 1;
    repeated uint32 Keys = 2 [packed = true];
    repeated uint32 Vals = 3 [packed = true];
    required sint64 Lat = 8;
    required sint64 Lon = 9;
}

message TDenseNodes {
    repeated sint64 Id = 1 [packed = true];
    repeated sint64 Lat = 8 [packed = true];
    repeated sint64 Lon = 9 [packed = true];
    repeated int32 Kvs = 10 [packed = true];
}

message TWay {
    required int64 Id = 1;
    repeated uint32 Keys = 2 [packed = true];
    repeated uint32 Vals = 3 [packed = true];
    repeated sint64 Refs = 8 [packed = true];
}

message TRelation {
    enum EMemberType {
        NODE = 0;
        WAY = 1;
        RELATION = 2;
    }

    required int64 Id = 1;
    repeated uint32 Keys = 2 [packed = true];
    repeated uint32 Vals = 3 [packed = true];
    repeated int32 RolesSid = 8 [packed = true];
    repeated sint64 MemberIds = 9 [packed = true];
    repeated EMemberType MemberTypes = 10 [packed = true];
}
