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

Function LocalizeStreet

libs/map/framework.cpp:2827–2843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2825namespace
2826{
2827bool LocalizeStreet(DataSource const & dataSource, FeatureID const & fid, osm::LocalizedStreet & result)
2828{
2829 FeaturesLoaderGuard g(dataSource, fid.m_mwmId);
2830 auto ft = g.GetFeatureByIndex(fid.m_index);
2831 if (!ft)
2832 return false;
2833
2834 result.m_defaultName = ft->GetName(localisation::kDefaultNameIndex);
2835
2836 optional<string> name = ft->GetTranslatedName().m_primary;
2837 if (name.has_value())
2838 result.m_localizedName = name.value();
2839
2840 if (result.m_localizedName == result.m_defaultName)
2841 result.m_localizedName.clear();
2842 return true;
2843}
2844
2845vector<osm::LocalizedStreet> TakeSomeStreetsAndLocalize(vector<search::ReverseGeocoder::Street> const & streets,
2846 DataSource const & dataSource)

Callers 2

SetStreetFunction · 0.85

Calls 6

GetTranslatedNameMethod · 0.80
has_valueMethod · 0.80
GetFeatureByIndexMethod · 0.45
GetNameMethod · 0.45
valueMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected