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

Function BuildCitiesBoundaries

generator/cities_boundaries_builder.cpp:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33
34template <class BoundariesTable, class MappingT>
35bool BuildCitiesBoundaries(string const & dataPath, BoundariesTable & table, MappingT const & mapping)
36{
37 auto const localities = GetLocalities(dataPath);
38
39 vector<vector<CityBoundary>> all;
40 localities.ForEach([&](uint64_t fid)
41 {
42 vector<CityBoundary> bs;
43
44 auto const it = mapping.find(base::asserted_cast<uint32_t>(fid));
45 if (it != mapping.end())
46 {
47 auto const & b = table.Get(it->second);
48 bs.insert(bs.end(), b.begin(), b.end());
49 }
50
51 all.emplace_back(std::move(bs));
52 });
53
54 FilesContainerW container(dataPath, FileWriter::OP_WRITE_EXISTING);
55 auto sink = container.GetWriter(CITIES_BOUNDARIES_FILE_TAG);
56 CitiesBoundariesSerDes::Serialize(*sink, all);
57
58 return true;
59}
60} // namespace
61
62bool BuildCitiesBoundaries(string const & dataPath, OsmIdToBoundariesTable & table)

Callers 3

generator_tool.cppFile · 0.85
BuildSearchMethod · 0.85

Calls 11

GetLocalitiesFunction · 0.85
SerializeFunction · 0.85
GetWriterMethod · 0.80
ForEachMethod · 0.45
findMethod · 0.45
endMethod · 0.45
GetMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
emplace_backMethod · 0.45

Tested by 1

BuildSearchMethod · 0.68