MCPcopy Create free account
hub / github.com/comaps/comaps / UnpackBorders

Function UnpackBorders

generator/borders.cpp:240–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238}
239
240void UnpackBorders(std::string const & baseDir, std::string const & targetDir)
241{
242 if (!Platform::IsFileExistsByFullPath(targetDir) && !Platform::MkDirChecked(targetDir))
243 MYTHROW(FileSystemException, ("Unable to find or create directory", targetDir));
244
245 std::vector<storage::CountryDef> countries;
246 FilesContainerR reader(base::JoinPath(baseDir, PACKED_POLYGONS_FILE));
247 ReaderSource<ModelReaderPtr> src(reader.GetReader(PACKED_POLYGONS_INFO_TAG));
248 rw::Read(src, countries);
249
250 for (size_t id = 0; id < countries.size(); id++)
251 {
252 storage::CountryId const mwmName = countries[id].m_countryId;
253
254 src = reader.GetReader(strings::to_string(id));
255
256 auto const polygons = ReadPolygonsOfOneBorder(src);
257 DumpBorderToPolyFile(targetDir, mwmName, polygons);
258 }
259}
260
261CountryPolygonsCollection const & GetOrCreateCountryPolygonsTree(std::string const & baseDir)
262{

Callers 1

generator_tool.cppFile · 0.85

Calls 7

JoinPathFunction · 0.85
to_stringFunction · 0.85
ReadPolygonsOfOneBorderFunction · 0.85
DumpBorderToPolyFileFunction · 0.85
ReadFunction · 0.50
GetReaderMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected