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

Function GetAffiliationName

libs/search/geocoder.cpp:242–258  ·  view source on GitHub ↗

@todo Can't change on string_view now, because of unordered_map Affiliations.

Source from the content-addressed store, hash-verified

240
241/// @todo Can't change on string_view now, because of unordered_map<string> Affiliations.
242[[nodiscard]] bool GetAffiliationName(FeatureType & ft, string & affiliation)
243{
244 string_view name = ft.GetName(localisation::kDefaultNameIndex);
245 if (name.empty())
246 {
247 // As a best effort, we try to read an english name if default name is absent.
248 name = ft.GetName(localisation::kEnglishLanguageIndex);
249 if (name.empty())
250 {
251 affiliation.clear();
252 return false;
253 }
254 }
255
256 affiliation = name;
257 return true;
258}
259
260double Area(m2::RectD const & rect)
261{

Callers 1

FillLocalitiesTableMethod · 0.85

Calls 3

GetNameMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected