| 300 | } |
| 301 | |
| 302 | string ReverseGeocoder::GetLocalizedRegionAddress(RegionAddress const & addr, RegionInfoGetter const & nameGetter) const |
| 303 | { |
| 304 | if (!addr.IsValid()) |
| 305 | return {}; |
| 306 | |
| 307 | string addrStr; |
| 308 | if (addr.m_featureId.IsValid()) |
| 309 | { |
| 310 | m_dataSource.ReadFeature([&addrStr](FeatureType & ft) { addrStr = ft.GetTranslatedName().m_primary.value(); }, addr.m_featureId); |
| 311 | |
| 312 | auto const countryName = addr.GetCountryName(); |
| 313 | if (!countryName.empty()) |
| 314 | { |
| 315 | RegionInfoGetter::NameBufferT nameParts; |
| 316 | nameGetter.GetLocalizedFullName(countryName, nameParts); |
| 317 | nameParts.insert(nameParts.begin(), std::move(addrStr)); |
| 318 | nameParts.erase(unique(nameParts.begin(), nameParts.end()), nameParts.end()); |
| 319 | addrStr = strings::JoinStrings(nameParts, ", "); |
| 320 | } |
| 321 | } |
| 322 | else |
| 323 | { |
| 324 | ASSERT(storage::IsCountryIdValid(addr.m_countryId), ()); |
| 325 | addrStr = nameGetter.GetLocalizedFullName(addr.m_countryId); |
| 326 | } |
| 327 | |
| 328 | return addrStr; |
| 329 | } |
| 330 | |
| 331 | // static |
| 332 | ReverseGeocoder::Building ReverseGeocoder::FromFeature(FeatureType & ft, double distMeters) |
nothing calls this directly
no test coverage detected