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

Method TranslatorCountry

generator/translator_country.cpp:74–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72} // namespace
73
74TranslatorCountry::TranslatorCountry(std::shared_ptr<FeatureProcessorInterface> const & processor,
75 std::shared_ptr<cache::IntermediateData> const & cache,
76 feature::GenerateInfo const & info, AffiliationInterfacePtr affiliation)
77 : Translator(processor, cache, std::make_shared<FeatureMaker>(cache->GetCache()))
78 /// @todo Looks like ways.csv was in some MM proprietary generator routine?!
79 , m_tagAdmixer(std::make_shared<TagAdmixer>(info.GetIntermediateFileName("ways", ".csv"),
80 info.GetIntermediateFileName(TOWNS_FILE)))
81 , m_tagReplacer(std::make_shared<TagReplacer>(base::JoinPath(GetPlatform().ResourcesDir(), REPLACED_TAGS_FILE)))
82{
83 /// @todo This option is not used, but may be useful in future?
84 // if (needMixTags)
85 // {
86 // m_osmTagMixer = std::make_shared<OsmTagMixer>(
87 // base::JoinPath(GetPlatform().ResourcesDir(), MIXED_TAGS_FILE));
88 // }
89
90 auto filters = std::make_shared<FilterCollection>();
91 filters->Append(std::make_shared<FilterPlanet>());
92 filters->Append(std::make_shared<FilterRoads>());
93 filters->Append(
94 std::make_shared<FilterElements>(base::JoinPath(GetPlatform().ResourcesDir(), SKIPPED_ELEMENTS_FILE)));
95
96 SetFilter(filters);
97
98 auto collectors = std::make_shared<CollectorCollection>();
99 collectors->Append(std::make_shared<feature::MetalinesBuilder>(info.GetIntermediateFileName(METALINES_FILENAME)));
100 collectors->Append(std::make_shared<BoundaryPostcodeCollector>(
101 info.GetIntermediateFileName(BOUNDARY_POSTCODES_FILENAME), cache->GetCache()));
102
103 // Collectors for gathering of additional information for the future building of routing section.
104 collectors->Append(std::make_shared<RoutingCityBoundariesCollector>(
105 info.GetIntermediateFileName(CITY_BOUNDARIES_COLLECTOR_FILENAME), cache->GetCache()));
106 collectors->Append(std::make_shared<MaxspeedsCollector>(info.GetIntermediateFileName(MAXSPEEDS_FILENAME)));
107 collectors->Append(std::make_shared<routing_builder::RestrictionWriter>(
108 info.GetIntermediateFileName(RESTRICTIONS_FILENAME), cache->GetCache()));
109 collectors->Append(std::make_shared<routing_builder::RoadAccessCollector>(
110 info.GetIntermediateFileName(ROAD_ACCESS_FILENAME), cache->GetCache()));
111 collectors->Append(std::make_shared<routing_builder::RoadPenaltyCollector>(
112 info.GetIntermediateFileName(ROAD_PENALTY_FILENAME), cache->GetCache()));
113 collectors->Append(std::make_shared<routing_builder::CameraCollector>(
114 info.GetIntermediateFileName(CAMERAS_TO_WAYS_FILENAME), cache->GetCache()));
115 collectors->Append(std::make_shared<MiniRoundaboutCollector>(info.GetIntermediateFileName(MINI_ROUNDABOUTS_FILENAME),
116 cache->GetCache()));
117 collectors->Append(std::make_shared<AddressesCollector>(info.GetIntermediateFileName(ADDR_INTERPOL_FILENAME)));
118
119 if (affiliation)
120 collectors->Append(std::make_shared<CrossMwmOsmWaysCollector>(info.m_intermediateDir, affiliation));
121
122 if (!info.m_idToWikidataFilename.empty())
123 {
124 collectors->Append(
125 std::make_shared<CollectorTag>(info.m_idToWikidataFilename, "wikidata" /* tagKey */, WikiDataValidator));
126 }
127
128 SetCollector(collectors);
129}
130
131std::shared_ptr<TranslatorInterface> TranslatorCountry::Clone() const

Callers

nothing calls this directly

Calls 4

JoinPathFunction · 0.85
AppendMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected