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

Function LoadCountriesList

generator/borders.cpp:181–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181CountryPolygonsCollection LoadCountriesList(std::string const & baseDir)
182{
183 LOG(LINFO, ("Loading countries in", BORDERS_DIR, "folder in", baseDir));
184
185 CountryPolygonsCollection countryPolygonsCollection;
186 ForEachCountry(baseDir, [&](std::string name, PolygonsList && borders)
187 {
188 PolygonsTree polygons;
189 for (Polygon & border : borders)
190 {
191 auto const rect = border.GetRect();
192 polygons.Add(std::move(border), rect);
193 }
194
195 countryPolygonsCollection.Add(CountryPolygons(std::move(name), std::move(polygons)));
196 });
197
198 LOG(LINFO, ("Countries loaded:", countryPolygonsCollection.GetSize()));
199 CHECK_NOT_EQUAL(countryPolygonsCollection.GetSize(), 0, (baseDir));
200 return countryPolygonsCollection;
201}
202
203void GeneratePackedBorders(std::string const & baseDir)
204{

Callers 1

borders.cppFile · 0.85

Calls 5

ForEachCountryFunction · 0.85
CountryPolygonsClass · 0.85
GetRectMethod · 0.45
AddMethod · 0.45
GetSizeMethod · 0.45

Tested by

no test coverage detected