forked from organicmaps/organicmaps
[kml] points with altitudes for tracks. review fixes
This commit is contained in:
parent
62440157fa
commit
bc449bdaa3
8 changed files with 170 additions and 11 deletions
|
@ -46,7 +46,7 @@ public:
|
|||
|
||||
public:
|
||||
Spline() = default;
|
||||
Spline(size_t reservedSize);
|
||||
explicit Spline(size_t reservedSize);
|
||||
explicit Spline(std::vector<PointD> const & path);
|
||||
explicit Spline(std::vector<PointD> && path);
|
||||
Spline const & operator = (Spline const & spl);
|
||||
|
|
|
@ -605,7 +605,7 @@ UNIT_TEST(Kml_Serialization_Text_File)
|
|||
}
|
||||
|
||||
// 8. Check binary deserialization of v.3 format.
|
||||
UNIT_TEST(Kml_Deserialization_Bin_V3)
|
||||
UNIT_TEST(Kml_Deserialization_From_Bin_V3_And_V4)
|
||||
{
|
||||
kml::FileData dataFromBinV3;
|
||||
try
|
||||
|
@ -633,3 +633,32 @@ UNIT_TEST(Kml_Deserialization_Bin_V3)
|
|||
|
||||
TEST_EQUAL(dataFromBinV3, dataFromBinV4, ());
|
||||
}
|
||||
|
||||
UNIT_TEST(Kml_Deserialization_From_Bin_V6_And_V7)
|
||||
{
|
||||
kml::FileData dataFromBinV6;
|
||||
try
|
||||
{
|
||||
MemReader reader(kBinKmlV6.data(), kBinKmlV6.size());
|
||||
kml::binary::DeserializerKml des(dataFromBinV6);
|
||||
des.Deserialize(reader);
|
||||
}
|
||||
catch (kml::binary::DeserializerKml::DeserializeException const & exc)
|
||||
{
|
||||
TEST(false, ("Exception raised", exc.what()));
|
||||
}
|
||||
|
||||
kml::FileData dataFromBinV7;
|
||||
try
|
||||
{
|
||||
MemReader reader(kBinKmlV7.data(), kBinKmlV7.size());
|
||||
kml::binary::DeserializerKml des(dataFromBinV7);
|
||||
des.Deserialize(reader);
|
||||
}
|
||||
catch (kml::binary::DeserializerKml::DeserializeException const & exc)
|
||||
{
|
||||
TEST(false, ("Exception raised", exc.what()));
|
||||
}
|
||||
|
||||
TEST_EQUAL(dataFromBinV6, dataFromBinV7, ());
|
||||
}
|
||||
|
|
|
@ -1405,3 +1405,119 @@ std::vector<uint8_t> const kBinKml = {
|
|||
0xB0, 0x45, 0xA7, 0x9D, 0x65, 0x6B, 0x78, 0xC7, 0xC6, 0xBA, 0x2D, 0x46, 0x83, 0x76, 0x08, 0xAC,
|
||||
0x14, 0x4B, 0x56, 0xA2, 0x09, 0x01, 0x00, 0x0D,
|
||||
};
|
||||
|
||||
std::vector<uint8_t> const kBinKmlV6 = {
|
||||
0x06, 0x00, 0x13, 0x41, 0x41, 0x41, 0x41, 0x2D, 0x42, 0x42, 0x42, 0x42, 0x2D, 0x43, 0x43, 0x43,
|
||||
0x43, 0x2D, 0x44, 0x44, 0x44, 0x44, 0x1E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x53, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x8E, 0x85, 0xD7, 0xC7, 0x03, 0x37, 0x02, 0x00,
|
||||
0x00, 0xE8, 0x07, 0x01, 0x03, 0x01, 0x02, 0x08, 0x09, 0x02, 0x00, 0x02, 0x08, 0x01, 0x02, 0x00,
|
||||
0x03, 0x01, 0x04, 0x02, 0x00, 0x06, 0x08, 0x05, 0x01, 0x00, 0x07, 0x01, 0x00, 0x08, 0x01, 0x00,
|
||||
0x09, 0x03, 0x00, 0x0A, 0x01, 0x0B, 0x02, 0x0C, 0x02, 0x00, 0x0D, 0x01, 0x0E, 0x04, 0x00, 0x0F,
|
||||
0x01, 0x10, 0x02, 0x11, 0x03, 0x12, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x02,
|
||||
0xCE, 0x02, 0x00, 0x00, 0xCB, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
|
||||
0xA0, 0x06, 0xB5, 0x9F, 0xA8, 0xC1, 0x02, 0x8C, 0xBE, 0xF0, 0xD0, 0x02, 0x01, 0x00, 0x00, 0x05,
|
||||
0x02, 0x00, 0x14, 0x08, 0x13, 0x02, 0x00, 0x16, 0x08, 0x15, 0x02, 0x00, 0x17, 0x01, 0x18, 0x01,
|
||||
0x00, 0x19, 0x04, 0x00, 0x1A, 0x01, 0x1B, 0x02, 0x1C, 0x03, 0x1D, 0x01, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x02, 0xBD, 0x94, 0xDC, 0x1E, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC8,
|
||||
0xC2, 0xEB, 0x23, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x84, 0x07, 0x03, 0xEA, 0xBE, 0xD0, 0x82, 0x05,
|
||||
0x98, 0xFC, 0xE0, 0xA1, 0x05, 0x85, 0xE5, 0xFE, 0x01, 0xAD, 0xC7, 0xD6, 0x01, 0xF1, 0x98, 0x0A,
|
||||
0xE2, 0xC4, 0x80, 0x02, 0x00, 0x04, 0x02, 0x00, 0x1F, 0x08, 0x1E, 0x02, 0x00, 0x21, 0x08, 0x20,
|
||||
0x03, 0x00, 0x22, 0x01, 0x23, 0x02, 0x24, 0x04, 0x00, 0x25, 0x01, 0x26, 0x02, 0x27, 0x03, 0x28,
|
||||
0x47, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0D, 0x0F, 0x0F, 0x21, 0x10, 0x19,
|
||||
0x07, 0x05, 0x09, 0x03, 0x09, 0x05, 0x05, 0x09, 0x06, 0x09, 0x06, 0x1B, 0x0D, 0x2C, 0x19, 0x20,
|
||||
0x11, 0x05, 0x0C, 0x06, 0x0C, 0x06, 0x19, 0x0A, 0x2C, 0x16, 0x05, 0x05, 0x05, 0x0C, 0x06, 0x0C,
|
||||
0x06, 0xCE, 0x03, 0x4F, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x03, 0x05, 0x02, 0x05, 0x07, 0x18,
|
||||
0x07, 0x06, 0x05, 0x09, 0x06, 0x06, 0x0B, 0x07, 0x04, 0x0D, 0x09, 0x6C, 0x0F, 0x05, 0x08, 0x13,
|
||||
0x05, 0x03, 0x15, 0x09, 0x2F, 0x17, 0x06, 0x10, 0x19, 0x07, 0x07, 0x1B, 0x06, 0x09, 0x1D, 0x08,
|
||||
0x7C, 0x1F, 0x07, 0x12, 0x25, 0x09, 0x23, 0x27, 0x06, 0x0D, 0x29, 0x07, 0x0C, 0x2B, 0x06, 0x0A,
|
||||
0x2D, 0x07, 0x78, 0x35, 0x09, 0x41, 0x37, 0x06, 0x14, 0x39, 0x09, 0xB5, 0x01, 0x3B, 0x07, 0x0E,
|
||||
0x3D, 0x08, 0x8D, 0x01, 0x3F, 0x07, 0x1A, 0x45, 0x09, 0x1C, 0x4B, 0x07, 0x0B, 0x4D, 0x08, 0x74,
|
||||
0x55, 0x08, 0x3E, 0x59, 0x09, 0xBF, 0x01, 0x5D, 0x08, 0x7E, 0x5F, 0x07, 0x16, 0x65, 0x08, 0x28,
|
||||
0x69, 0x08, 0x0F, 0x6D, 0x08, 0x79, 0x75, 0x08, 0x44, 0x79, 0x08, 0xBB, 0x01, 0x7B, 0x09, 0x13,
|
||||
0x7D, 0x09, 0x9B, 0x01, 0x7F, 0x07, 0x1B, 0x8D, 0x01, 0x09, 0x6E, 0x95, 0x01, 0x09, 0x3B, 0x9D,
|
||||
0x01, 0x08, 0x7D, 0xA5, 0x01, 0x08, 0x26, 0xB5, 0x01, 0x08, 0x42, 0xB9, 0x01, 0x08, 0xB9, 0x01,
|
||||
0xBD, 0x01, 0x09, 0x8F, 0x01, 0xC5, 0x01, 0x09, 0x21, 0xCD, 0x01, 0x09, 0x75, 0xD5, 0x01, 0x08,
|
||||
0x40, 0xD9, 0x01, 0x08, 0xC1, 0x01, 0xDD, 0x01, 0x08, 0x7F, 0xE5, 0x01, 0x09, 0x29, 0xE9, 0x01,
|
||||
0x08, 0xD1, 0x01, 0xED, 0x01, 0x08, 0x7B, 0xF5, 0x01, 0x09, 0x61, 0xF9, 0x01, 0x09, 0xBD, 0x01,
|
||||
0xFB, 0x01, 0x08, 0x17, 0xFD, 0x01, 0x09, 0xAC, 0x01, 0x8D, 0x02, 0x09, 0x6D, 0x95, 0x02, 0x09,
|
||||
0x39, 0xA5, 0x02, 0x09, 0x24, 0xB5, 0x02, 0x09, 0x43, 0xB9, 0x02, 0x09, 0xBA, 0x01, 0xC5, 0x02,
|
||||
0x09, 0x20, 0xD9, 0x02, 0x09, 0xC0, 0x01, 0xFB, 0x02, 0x09, 0x15, 0xFD, 0x02, 0x09, 0xAA, 0x01,
|
||||
0x8D, 0x03, 0x09, 0x6F, 0x95, 0x03, 0x09, 0x3F, 0xBD, 0x03, 0x09, 0x98, 0x01, 0xC5, 0x03, 0x09,
|
||||
0x22, 0xCD, 0x03, 0x09, 0x8A, 0x01, 0xE5, 0x03, 0x09, 0x2A, 0xF5, 0x03, 0x09, 0x68, 0xF9, 0x03,
|
||||
0x09, 0xBE, 0x01, 0xFD, 0x03, 0x09, 0xB4, 0x01, 0xC0, 0x04, 0x4D, 0xD0, 0x20, 0xA2, 0xAD, 0xFE,
|
||||
0xD4, 0x2B, 0x87, 0x08, 0xE4, 0x46, 0xAB, 0x52, 0x6D, 0x52, 0x51, 0x53, 0xC3, 0x55, 0x55, 0x44,
|
||||
0x48, 0x11, 0x4F, 0x15, 0x4C, 0xA6, 0x45, 0x65, 0x81, 0x6A, 0x09, 0xC2, 0x44, 0x8D, 0xDA, 0x9A,
|
||||
0x75, 0xEB, 0xD5, 0xB8, 0x2E, 0xFF, 0xEE, 0xCA, 0xD9, 0xBF, 0xB0, 0x3F, 0xF2, 0x5A, 0x1D, 0xA2,
|
||||
0x6D, 0xF8, 0x35, 0xEB, 0x02, 0xD5, 0xEA, 0xB5, 0x3F, 0x47, 0xA2, 0xF5, 0xFF, 0x76, 0x6F, 0x5E,
|
||||
0xB4, 0x28, 0x70, 0x4E, 0xB6, 0x35, 0xD5, 0x0D, 0x66, 0x17, 0x28, 0x41, 0x23, 0x40, 0xA6, 0x50,
|
||||
0xF2, 0x1E, 0xE7, 0x83, 0x14, 0x65, 0x71, 0xC6, 0x2E, 0xCD, 0x98, 0x67, 0xA6, 0x34, 0x40, 0xBB,
|
||||
0xE7, 0x7E, 0x92, 0x38, 0x2C, 0xAD, 0x9D, 0x9F, 0xC3, 0xB6, 0x1B, 0x16, 0x30, 0x9D, 0xA0, 0x50,
|
||||
0xAC, 0x73, 0xF5, 0x8B, 0x07, 0xEE, 0xE2, 0x1D, 0xFF, 0x10, 0x71, 0x7D, 0x77, 0x04, 0xC6, 0x97,
|
||||
0x37, 0xEC, 0x01, 0xFB, 0x60, 0x0E, 0x83, 0x3B, 0x93, 0x9A, 0x80, 0x63, 0x01, 0x30, 0x87, 0x45,
|
||||
0x92, 0x44, 0x88, 0xB7, 0x77, 0x79, 0x4A, 0xFB, 0x80, 0x1B, 0xAC, 0x07, 0xE5, 0xD9, 0xE6, 0x7F,
|
||||
0x05, 0x99, 0x74, 0x00, 0x00, 0x00, 0x90, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x69, 0xCF, 0xCF, 0x18, 0x45, 0x35, 0x27, 0x72, 0xF5, 0x2E, 0x07, 0x4A, 0x43, 0x59,
|
||||
0x10, 0x7A, 0x7A, 0x64, 0xE9, 0x07, 0xC2, 0x96, 0x95, 0xBC, 0x6C, 0x92, 0x3E, 0xCB, 0x2D, 0x8A,
|
||||
0x8C, 0xC0, 0xB2, 0x02, 0x13, 0xE8, 0x9B, 0xBA, 0x48, 0xC8, 0x77, 0x91, 0x88, 0xC7, 0x06, 0x6C,
|
||||
0xE1, 0x03, 0x64, 0xBC, 0xEC, 0x43, 0x02, 0x01, 0x00, 0x29,
|
||||
};
|
||||
|
||||
std::vector<uint8_t> const kBinKmlV7 = {
|
||||
0x07, 0x00, 0x13, 0x41, 0x41, 0x41, 0x41, 0x2D, 0x42, 0x42, 0x42, 0x42, 0x2D, 0x43, 0x43, 0x43,
|
||||
0x43, 0x2D, 0x44, 0x44, 0x44, 0x44, 0x1E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6F,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C,
|
||||
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x8E, 0x85, 0xD7, 0xC7, 0x03, 0x37, 0x02, 0x00,
|
||||
0x00, 0xE8, 0x07, 0x01, 0x03, 0x01, 0x02, 0x08, 0x09, 0x02, 0x00, 0x02, 0x08, 0x01, 0x02, 0x00,
|
||||
0x03, 0x01, 0x04, 0x02, 0x00, 0x06, 0x08, 0x05, 0x01, 0x00, 0x07, 0x01, 0x00, 0x08, 0x01, 0x00,
|
||||
0x09, 0x03, 0x00, 0x0A, 0x01, 0x0B, 0x02, 0x0C, 0x02, 0x00, 0x0D, 0x01, 0x0E, 0x04, 0x00, 0x0F,
|
||||
0x01, 0x10, 0x02, 0x11, 0x03, 0x12, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x02,
|
||||
0xCE, 0x02, 0x00, 0x00, 0xCB, 0x02, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F,
|
||||
0xA0, 0x06, 0xB5, 0x9F, 0xA8, 0xC1, 0x02, 0x8C, 0xBE, 0xF0, 0xD0, 0x02, 0x01, 0x00, 0x00, 0x05,
|
||||
0x02, 0x00, 0x14, 0x08, 0x13, 0x02, 0x00, 0x16, 0x08, 0x15, 0x02, 0x00, 0x17, 0x01, 0x18, 0x01,
|
||||
0x00, 0x19, 0x04, 0x00, 0x1A, 0x01, 0x1B, 0x02, 0x1C, 0x03, 0x1D, 0x01, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||
0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x02, 0xBD, 0x94, 0xDC, 0x1E, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0xC8,
|
||||
0xC2, 0xEB, 0x23, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x84, 0x07, 0x03, 0xEA, 0xBE, 0xD0, 0x82, 0x05,
|
||||
0x98, 0xFC, 0xE0, 0xA1, 0x05, 0x85, 0xE5, 0xFE, 0x01, 0xAD, 0xC7, 0xD6, 0x01, 0xF1, 0x98, 0x0A,
|
||||
0xE2, 0xC4, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x00, 0x1F, 0x08, 0x1E, 0x02, 0x00,
|
||||
0x21, 0x08, 0x20, 0x03, 0x00, 0x22, 0x01, 0x23, 0x02, 0x24, 0x04, 0x00, 0x25, 0x01, 0x26, 0x02,
|
||||
0x27, 0x03, 0x28, 0x47, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x0D, 0x0F, 0x0F,
|
||||
0x21, 0x10, 0x19, 0x07, 0x05, 0x09, 0x03, 0x09, 0x05, 0x05, 0x09, 0x06, 0x09, 0x06, 0x1B, 0x0D,
|
||||
0x2C, 0x19, 0x20, 0x11, 0x05, 0x0C, 0x06, 0x0C, 0x06, 0x19, 0x0A, 0x2C, 0x16, 0x05, 0x05, 0x05,
|
||||
0x0C, 0x06, 0x0C, 0x06, 0xCE, 0x03, 0x4F, 0x00, 0x01, 0x00, 0x01, 0x04, 0x01, 0x03, 0x05, 0x02,
|
||||
0x05, 0x07, 0x18, 0x07, 0x06, 0x05, 0x09, 0x06, 0x06, 0x0B, 0x07, 0x04, 0x0D, 0x09, 0x6C, 0x0F,
|
||||
0x05, 0x08, 0x13, 0x05, 0x03, 0x15, 0x09, 0x2F, 0x17, 0x06, 0x10, 0x19, 0x07, 0x07, 0x1B, 0x06,
|
||||
0x09, 0x1D, 0x08, 0x7C, 0x1F, 0x07, 0x12, 0x25, 0x09, 0x23, 0x27, 0x06, 0x0D, 0x29, 0x07, 0x0C,
|
||||
0x2B, 0x06, 0x0A, 0x2D, 0x07, 0x78, 0x35, 0x09, 0x41, 0x37, 0x06, 0x14, 0x39, 0x09, 0xB5, 0x01,
|
||||
0x3B, 0x07, 0x0E, 0x3D, 0x08, 0x8D, 0x01, 0x3F, 0x07, 0x1A, 0x45, 0x09, 0x1C, 0x4B, 0x07, 0x0B,
|
||||
0x4D, 0x08, 0x74, 0x55, 0x08, 0x3E, 0x59, 0x09, 0xBF, 0x01, 0x5D, 0x08, 0x7E, 0x5F, 0x07, 0x16,
|
||||
0x65, 0x08, 0x28, 0x69, 0x08, 0x0F, 0x6D, 0x08, 0x79, 0x75, 0x08, 0x44, 0x79, 0x08, 0xBB, 0x01,
|
||||
0x7B, 0x09, 0x13, 0x7D, 0x09, 0x9B, 0x01, 0x7F, 0x07, 0x1B, 0x8D, 0x01, 0x09, 0x6E, 0x95, 0x01,
|
||||
0x09, 0x3B, 0x9D, 0x01, 0x08, 0x7D, 0xA5, 0x01, 0x08, 0x26, 0xB5, 0x01, 0x08, 0x42, 0xB9, 0x01,
|
||||
0x08, 0xB9, 0x01, 0xBD, 0x01, 0x09, 0x8F, 0x01, 0xC5, 0x01, 0x09, 0x21, 0xCD, 0x01, 0x09, 0x75,
|
||||
0xD5, 0x01, 0x08, 0x40, 0xD9, 0x01, 0x08, 0xC1, 0x01, 0xDD, 0x01, 0x08, 0x7F, 0xE5, 0x01, 0x09,
|
||||
0x29, 0xE9, 0x01, 0x08, 0xD1, 0x01, 0xED, 0x01, 0x08, 0x7B, 0xF5, 0x01, 0x09, 0x61, 0xF9, 0x01,
|
||||
0x09, 0xBD, 0x01, 0xFB, 0x01, 0x08, 0x17, 0xFD, 0x01, 0x09, 0xAC, 0x01, 0x8D, 0x02, 0x09, 0x6D,
|
||||
0x95, 0x02, 0x09, 0x39, 0xA5, 0x02, 0x09, 0x24, 0xB5, 0x02, 0x09, 0x43, 0xB9, 0x02, 0x09, 0xBA,
|
||||
0x01, 0xC5, 0x02, 0x09, 0x20, 0xD9, 0x02, 0x09, 0xC0, 0x01, 0xFB, 0x02, 0x09, 0x15, 0xFD, 0x02,
|
||||
0x09, 0xAA, 0x01, 0x8D, 0x03, 0x09, 0x6F, 0x95, 0x03, 0x09, 0x3F, 0xBD, 0x03, 0x09, 0x98, 0x01,
|
||||
0xC5, 0x03, 0x09, 0x22, 0xCD, 0x03, 0x09, 0x8A, 0x01, 0xE5, 0x03, 0x09, 0x2A, 0xF5, 0x03, 0x09,
|
||||
0x68, 0xF9, 0x03, 0x09, 0xBE, 0x01, 0xFD, 0x03, 0x09, 0xB4, 0x01, 0xC0, 0x04, 0x4D, 0xD0, 0x20,
|
||||
0xA2, 0xAD, 0xFE, 0xD4, 0x2B, 0x87, 0x08, 0xE4, 0x46, 0xAB, 0x52, 0x6D, 0x52, 0x51, 0x53, 0xC3,
|
||||
0x55, 0x55, 0x44, 0x48, 0x11, 0x4F, 0x15, 0x4C, 0xA6, 0x45, 0x65, 0x81, 0x6A, 0x09, 0xC2, 0x44,
|
||||
0x8D, 0xDA, 0x9A, 0x75, 0xEB, 0xD5, 0xB8, 0x2E, 0xFF, 0xEE, 0xCA, 0xD9, 0xBF, 0xB0, 0x3F, 0xF2,
|
||||
0x5A, 0x1D, 0xA2, 0x6D, 0xF8, 0x35, 0xEB, 0x02, 0xD5, 0xEA, 0xB5, 0x3F, 0x47, 0xA2, 0xF5, 0xFF,
|
||||
0x76, 0x6F, 0x5E, 0xB4, 0x28, 0x70, 0x4E, 0xB6, 0x35, 0xD5, 0x0D, 0x66, 0x17, 0x28, 0x41, 0x23,
|
||||
0x40, 0xA6, 0x50, 0xF2, 0x1E, 0xE7, 0x83, 0x14, 0x65, 0x71, 0xC6, 0x2E, 0xCD, 0x98, 0x67, 0xA6,
|
||||
0x34, 0x40, 0xBB, 0xE7, 0x7E, 0x92, 0x38, 0x2C, 0xAD, 0x9D, 0x9F, 0xC3, 0xB6, 0x1B, 0x16, 0x30,
|
||||
0x9D, 0xA0, 0x50, 0xAC, 0x73, 0xF5, 0x8B, 0x07, 0xEE, 0xE2, 0x1D, 0xFF, 0x10, 0x71, 0x7D, 0x77,
|
||||
0x04, 0xC6, 0x97, 0x37, 0xEC, 0x01, 0xFB, 0x60, 0x0E, 0x83, 0x3B, 0x93, 0x9A, 0x80, 0x63, 0x01,
|
||||
0x30, 0x87, 0x45, 0x92, 0x44, 0x88, 0xB7, 0x77, 0x79, 0x4A, 0xFB, 0x80, 0x1B, 0xAC, 0x07, 0xE5,
|
||||
0xD9, 0xE6, 0x7F, 0x05, 0x99, 0x74, 0x00, 0x00, 0x00, 0x90, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0xCF, 0xCF, 0x18, 0x45, 0x35, 0x27, 0x72, 0xF5, 0x2E, 0x07,
|
||||
0x4A, 0x43, 0x59, 0x10, 0x7A, 0x7A, 0x64, 0xE9, 0x07, 0xC2, 0x96, 0x95, 0xBC, 0x6C, 0x92, 0x3E,
|
||||
0xCB, 0x2D, 0x8A, 0x8C, 0xC0, 0xB2, 0x02, 0x13, 0xE8, 0x9B, 0xBA, 0x48, 0xC8, 0x77, 0x91, 0x88,
|
||||
0xC7, 0x06, 0x6C, 0xE1, 0x03, 0x64, 0xBC, 0xEC, 0x43, 0x02, 0x01, 0x00, 0x29,
|
||||
};
|
||||
|
|
|
@ -167,6 +167,8 @@ inline std::string ToString(BookmarkIcon icon)
|
|||
UNREACHABLE();
|
||||
}
|
||||
|
||||
// Note: any changes in binary format of this structure
|
||||
// will affect previous kmb versions, where this structure was used.
|
||||
struct ColorData
|
||||
{
|
||||
DECLARE_VISITOR_AND_DEBUG_PRINT(ColorData, visitor(m_predefinedColor, "predefinedColor"),
|
||||
|
@ -185,6 +187,10 @@ struct ColorData
|
|||
uint32_t m_rgba = 0;
|
||||
};
|
||||
|
||||
// This structure is used in FileDataV6 because
|
||||
// its binary format is the same as in kmb version 6.
|
||||
// Make a copy of this structure in a file types_v<n>.hpp
|
||||
// in case of any changes of its binary format.
|
||||
struct BookmarkData
|
||||
{
|
||||
DECLARE_VISITOR_AND_DEBUG_PRINT(BookmarkData, visitor(m_id, "id"),
|
||||
|
@ -255,6 +261,8 @@ struct BookmarkData
|
|||
Properties m_properties;
|
||||
};
|
||||
|
||||
// Note: any changes in binary format of this structure
|
||||
// will affect previous kmb versions, where this structure was used.
|
||||
struct TrackLayer
|
||||
{
|
||||
DECLARE_VISITOR_AND_DEBUG_PRINT(TrackLayer, visitor(m_lineWidth, "lineWidth"),
|
||||
|
@ -324,6 +332,10 @@ struct TrackData
|
|||
Properties m_properties;
|
||||
};
|
||||
|
||||
// This structure is used in FileDataV6 because
|
||||
// its binary format is the same as in kmb version 6.
|
||||
// Make a copy of this structure in a file types_v<n>.hpp
|
||||
// in case of any changes of its binary format.
|
||||
struct CategoryData
|
||||
{
|
||||
DECLARE_VISITOR_AND_DEBUG_PRINT(CategoryData, visitor(m_id, "id"),
|
||||
|
|
|
@ -48,7 +48,7 @@ struct BookmarkDataV3
|
|||
|
||||
bool operator!=(BookmarkDataV3 const & data) const { return !operator==(data); }
|
||||
|
||||
BookmarkData ConvertToLatestVersion() const
|
||||
BookmarkData ConvertToLatestVersion()
|
||||
{
|
||||
BookmarkData data;
|
||||
data.m_id = m_id;
|
||||
|
@ -111,7 +111,7 @@ struct TrackDataV3
|
|||
|
||||
bool operator!=(TrackDataV3 const & data) const { return !operator==(data); }
|
||||
|
||||
TrackData ConvertToLatestVersion() const
|
||||
TrackData ConvertToLatestVersion()
|
||||
{
|
||||
TrackData data;
|
||||
data.m_id = m_id;
|
||||
|
@ -179,7 +179,7 @@ struct CategoryDataV3
|
|||
|
||||
bool operator!=(CategoryDataV3 const & data) const { return !operator==(data); }
|
||||
|
||||
CategoryData ConvertToLatestVersion() const
|
||||
CategoryData ConvertToLatestVersion()
|
||||
{
|
||||
// We don't convert m_cities to m_toponyms, since m_cities have been never used.
|
||||
CategoryData data;
|
||||
|
@ -261,7 +261,7 @@ struct FileDataV3
|
|||
// Tracks collection.
|
||||
std::vector<TrackDataV3> m_tracksData;
|
||||
|
||||
FileData ConvertToLatestVersion() const
|
||||
FileData ConvertToLatestVersion()
|
||||
{
|
||||
FileData data;
|
||||
data.m_deviceId = m_deviceId;
|
||||
|
@ -269,11 +269,11 @@ struct FileDataV3
|
|||
data.m_categoryData = m_categoryData.ConvertToLatestVersion();
|
||||
|
||||
data.m_bookmarksData.reserve(m_bookmarksData.size());
|
||||
for (auto const & d : m_bookmarksData)
|
||||
for (auto & d : m_bookmarksData)
|
||||
data.m_bookmarksData.emplace_back(d.ConvertToLatestVersion());
|
||||
|
||||
data.m_tracksData.reserve(m_tracksData.size());
|
||||
for (auto const & d : m_tracksData)
|
||||
for (auto & d : m_tracksData)
|
||||
data.m_tracksData.emplace_back(d.ConvertToLatestVersion());
|
||||
|
||||
return data;
|
||||
|
|
|
@ -43,7 +43,7 @@ struct TrackDataV6
|
|||
|
||||
bool operator!=(TrackDataV6 const & data) const { return !operator==(data); }
|
||||
|
||||
TrackData ConvertToLatestVersion() const
|
||||
TrackData ConvertToLatestVersion()
|
||||
{
|
||||
TrackData data;
|
||||
data.m_id = m_id;
|
||||
|
@ -98,7 +98,7 @@ struct FileDataV6
|
|||
|
||||
bool operator!=(FileDataV6 const & data) const { return !operator==(data); }
|
||||
|
||||
FileData ConvertToLatestVersion() const
|
||||
FileData ConvertToLatestVersion()
|
||||
{
|
||||
FileData data;
|
||||
data.m_deviceId = m_deviceId;
|
||||
|
@ -107,7 +107,7 @@ struct FileDataV6
|
|||
data.m_bookmarksData = m_bookmarksData;
|
||||
|
||||
data.m_tracksData.reserve(m_tracksData.size());
|
||||
for (auto const & track : m_tracksData)
|
||||
for (auto & track : m_tracksData)
|
||||
data.m_tracksData.emplace_back(track.ConvertToLatestVersion());
|
||||
|
||||
return data;
|
||||
|
|
|
@ -79,6 +79,7 @@ float Track::GetDepth(size_t layerIndex) const
|
|||
std::vector<m2::PointD> Track::GetPoints() const
|
||||
{
|
||||
std::vector<m2::PointD> result;
|
||||
result.reserve(m_data.m_pointsWithAltitudes.size());
|
||||
for (auto const & pt : m_data.m_pointsWithAltitudes)
|
||||
result.push_back(pt.GetPoint());
|
||||
|
||||
|
|
|
@ -130,6 +130,7 @@ void GenerateTracks(string const & inputDir, string const & outputDir, routing::
|
|||
for (auto & track : data.m_tracksData)
|
||||
{
|
||||
std::vector<m2::PointD> waypoints;
|
||||
waypoints.reserve(track.m_pointsWithAltitudes.size());
|
||||
for (auto const & pt : track.m_pointsWithAltitudes)
|
||||
waypoints.push_back(pt.GetPoint());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue