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

Method GenerateCountries

generator/raw_generator.cpp:91–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void RawGenerator::GenerateCountries(bool isTests /* = false*/)
92{
93 // if (!m_genInfo.m_complexHierarchyFilename.empty())
94 // m_hierarchyNodesSet = GetOrCreateComplexLoader(m_genInfo.m_complexHierarchyFilename).GetIdsSet();
95 // auto const complexFeaturesMixer = std::make_shared<ComplexFeaturesMixer>(m_hierarchyNodesSet);
96
97 AffiliationInterfacePtr affiliation;
98 if (isTests)
99 {
100 affiliation = std::make_shared<feature::SingleAffiliation>(m_genInfo.m_fileName);
101 }
102 else
103 {
104 affiliation = std::make_shared<feature::CountriesFilesIndexAffiliation>(m_genInfo.m_targetDir,
105 m_genInfo.m_haveBordersForWholeWorld);
106 }
107
108 auto processor = CreateProcessor(ProcessorType::Country, affiliation, m_queue);
109
110 /// @todo Better design is to have one Translator that creates FeatureBuilder from OsmElement
111 /// and dispatches FB into Coastline, World, Country, City processors.
112 /// Now we have at least 2x similar work in OsmElement->GetNameAndType->FeatureBuilder (for Country and World).
113
114 m_translators->Append(
115 CreateTranslator(TranslatorType::Country, processor, m_cache, m_genInfo, isTests ? nullptr : affiliation));
116
117 m_finalProcessors.emplace(CreateCountryFinalProcessor(affiliation, false));
118 m_finalProcessors.emplace(CreatePlacesFinalProcessor(affiliation));
119}
120
121void RawGenerator::GenerateWorld(bool cutBordersByWater /* = true */)
122{

Callers 7

generator_tool.cppFile · 0.80
BuildWorldMethod · 0.80
BuildCountriesMethod · 0.80
CheckGeneratedDataMethod · 0.80
BuildFBMethod · 0.80

Calls 4

CreateProcessorFunction · 0.85
CreateTranslatorFunction · 0.85
AppendMethod · 0.45
emplaceMethod · 0.45

Tested by 6

BuildWorldMethod · 0.64
BuildCountriesMethod · 0.64
CheckGeneratedDataMethod · 0.64
BuildFBMethod · 0.64