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

Method DumpPolyFiles

tools/poly_borders/borders_data.cpp:192–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void BordersData::DumpPolyFiles(std::string const & targetDir)
193{
194 size_t n = m_bordersPolygons.size();
195 for (size_t i = 0; i < n;)
196 {
197 // Russia_Moscow.poly1 -> Russia_Moscow.poly
198 auto name = RemoveIndexFromMwmName(m_indexToPolyFileName.at(i));
199
200 size_t j = i + 1;
201 while (j < n && name == RemoveIndexFromMwmName(m_indexToPolyFileName.at(j)))
202 ++j;
203
204 std::vector<m2::RegionD> regions;
205 for (; i < j; i++)
206 {
207 if (ShouldLog(i, n))
208 LOG(LINFO, ("Dumping poly files:", i + 1, "/", n));
209
210 m2::RegionD region;
211 for (auto const & markedPoint : m_bordersPolygons[i].m_points)
212 region.AddPoint(markedPoint.m_point);
213
214 regions.emplace_back(std::move(region));
215 }
216
217 CHECK(strings::ReplaceFirst(name, kBorderExtension, ""), (name));
218 borders::DumpBorderToPolyFile(targetDir, name, regions);
219 }
220}
221
222size_t BordersData::RemoveDuplicatePoints()
223{

Callers 1

mainFunction · 0.80

Calls 8

RemoveIndexFromMwmNameFunction · 0.85
ShouldLogFunction · 0.85
ReplaceFirstFunction · 0.85
DumpBorderToPolyFileFunction · 0.85
atMethod · 0.80
sizeMethod · 0.45
AddPointMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected