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

Method PackIsolinesForCountries

tools/topography_generator/generator.cpp:629–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629void Generator::PackIsolinesForCountries()
630{
631 if (!GetPlatform().IsFileExistsByFullPath(m_isolinesCountriesOutDir) &&
632 !GetPlatform().MkDirRecursively(m_isolinesCountriesOutDir))
633 {
634 LOG(LERROR, ("Can't create directory", m_isolinesCountriesOutDir));
635 return;
636 }
637
638 base::ComputationalThreadPool threadPool(m_threadsCount);
639 size_t taskInd = 0;
640 size_t tasksCount = m_countriesToGenerate.m_countryParams.size();
641 for (auto const & countryParams : m_countriesToGenerate.m_countryParams)
642 {
643 auto const & countryId = countryParams.first;
644 auto const & params = countryParams.second;
645
646 threadPool.SubmitWork([this, countryId, taskInd, tasksCount, params]()
647 {
648 LOG(LINFO, ("Begin task", taskInd, "/", tasksCount, countryId));
649
650 auto const & packingParams = m_profileToPackingParams.at(params.m_profileName);
651 PackIsolinesForCountry(countryId, packingParams,
652 [&params](int lat, int lon) { return params.NeedSkipTile(lat, lon); });
653
654 LOG(LINFO, ("End task", taskInd, "/", tasksCount, countryId));
655 });
656 ++taskInd;
657 }
658}
659
660void Generator::InitCountryInfoGetter(std::string const & dataDir)
661{

Callers 1

main.cppFile · 0.80

Calls 5

MkDirRecursivelyMethod · 0.80
SubmitWorkMethod · 0.80
atMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected