diff options
author | Mikhail Gorbushin <m.gorbushin@corp.mail.ru> | 2019-06-12 20:54:27 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-06-17 16:40:55 +0300 |
commit | 4025f9f9f16c216983f08b1854f918bcb539efa8 (patch) | |
tree | 3335051fc3f0eb1523931fcc5e93e6200886523f /generator | |
parent | 64e4c4ebe7d18474381f852452dc25f7f3487e1f (diff) |
[qt] add option - draw borders from packed_polygon.bin
Diffstat (limited to 'generator')
-rw-r--r-- | generator/borders.cpp | 4 | ||||
-rw-r--r-- | generator/borders.hpp | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/generator/borders.cpp b/generator/borders.cpp index 9b70fc933c..526cffe01a 100644 --- a/generator/borders.cpp +++ b/generator/borders.cpp @@ -241,7 +241,7 @@ void GeneratePackedBorders(std::string const & baseDir) } void DumpBorderToPolyFile(std::string const & targetDir, storage::CountryId const & mwmName, - std::vector<std::vector<m2::PointD>> const & polygons) + std::vector<m2::RegionD> const & polygons) { CHECK(!polygons.empty(), ()); @@ -255,7 +255,7 @@ void DumpBorderToPolyFile(std::string const & targetDir, storage::CountryId cons { poly << polygonId << std::endl; ++polygonId; - for (auto const & point : points) + for (auto const & point : points.Data()) { ms::LatLon const ll = MercatorBounds::ToLatLon(point); poly << " " << std::scientific << ll.m_lon << " " << ll.m_lat << std::endl; diff --git a/generator/borders.hpp b/generator/borders.hpp index 2210ffc6e2..8be11528b9 100644 --- a/generator/borders.hpp +++ b/generator/borders.hpp @@ -3,6 +3,7 @@ #include "storage/storage_defines.hpp" #include "coding/geometry_coding.hpp" +#include "coding/reader.hpp" #include "geometry/rect2d.hpp" #include "geometry/region2d.hpp" @@ -68,21 +69,21 @@ bool LoadCountriesList(std::string const & baseDir, CountriesContainer & countri void GeneratePackedBorders(std::string const & baseDir); template <typename Source> -std::vector<std::vector<m2::PointD>> ReadPolygonsOfOneBorder(Source & src) +std::vector<m2::RegionD> ReadPolygonsOfOneBorder(Source & src) { auto const count = ReadVarUint<uint32_t>(src); - std::vector<std::vector<m2::PointD>> result(count); + std::vector<m2::RegionD> result(count); for (size_t i = 0; i < count; ++i) { std::vector<m2::PointD> points; serial::LoadOuterPath(src, serial::GeometryCodingParams(), points); - result[i] = std::move(points); + result[i] = m2::RegionD(std::move(points)); } return result; } void DumpBorderToPolyFile(std::string const & filePath, storage::CountryId const & mwmName, - std::vector<std::vector<m2::PointD>> const & polygons); + std::vector<m2::RegionD> const & polygons); void UnpackBorders(std::string const & baseDir, std::string const & targetDir); } // namespace borders |