| 269 | } |
| 270 | |
| 271 | void ReverseGeocoder::GetNearbyBuildings(m2::PointD const & center, double radius, vector<Building> & buildings) const |
| 272 | { |
| 273 | auto const addBuilding = [&](FeatureType & ft) |
| 274 | { |
| 275 | std::string const & hn = GetHouseNumber(ft); |
| 276 | if (hn.empty()) |
| 277 | return; |
| 278 | |
| 279 | auto const distance = feature::GetMinDistanceMeters(ft, center); |
| 280 | if (distance <= radius) |
| 281 | buildings.push_back(FromFeatureImpl(ft, hn, distance)); |
| 282 | }; |
| 283 | |
| 284 | auto const stop = [&]() { return buildings.size() >= kMaxNumTriesToApproxAddress; }; |
| 285 | |
| 286 | m_dataSource.ForClosestToPoint(addBuilding, stop, center, radius, kQueryScale); |
| 287 | sort(buildings.begin(), buildings.end(), base::LessBy(&Building::m_distanceMeters)); |
| 288 | } |
| 289 | |
| 290 | // static |
| 291 | ReverseGeocoder::RegionAddress ReverseGeocoder::GetNearbyRegionAddress(m2::PointD const & center, |
nothing calls this directly
no test coverage detected