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

Method GetNearbyBuildings

libs/search/reverse_geocoder.cpp:271–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271void 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
291ReverseGeocoder::RegionAddress ReverseGeocoder::GetNearbyRegionAddress(m2::PointD const & center,

Callers

nothing calls this directly

Calls 9

GetMinDistanceMetersFunction · 0.85
FromFeatureImplFunction · 0.85
LessByFunction · 0.85
ForClosestToPointMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected