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

Function GetNearbyObjects

libs/search/reverse_geocoder.cpp:87–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85
86template <class ObjT, class FilterT>
87vector<ObjT> GetNearbyObjects(search::MwmContext & context, m2::PointD const & center, double radiusM,
88 FilterT && filter, bool ignoreEditedStatus = false)
89{
90 vector<ObjT> objs;
91
92 m2::RectD const rect = GetLookupRect(center, radiusM);
93 context.ForEachFeature(rect, [&](FeatureType & ft)
94 {
95 if (filter(ft))
96 {
97 optional<string> const name = ft.GetTranslatedName().m_primary;
98 if (name.has_value())
99 objs.emplace_back(ft.GetID(), feature::GetMinDistanceMeters(ft, center), name.value(), ft.GetNames());
100 }
101 }, ignoreEditedStatus);
102
103 sort(objs.begin(), objs.end(), base::LessBy(&ObjT::m_distanceMeters));
104 return objs;
105}
106
107vector<ReverseGeocoder::Street> ReverseGeocoder::GetNearbyStreets(search::MwmContext & context,
108 m2::PointD const & center, double radiusM,

Callers

nothing calls this directly

Calls 12

GetLookupRectFunction · 0.85
GetMinDistanceMetersFunction · 0.85
LessByFunction · 0.85
GetTranslatedNameMethod · 0.80
has_valueMethod · 0.80
ForEachFeatureMethod · 0.45
emplace_backMethod · 0.45
GetIDMethod · 0.45
valueMethod · 0.45
GetNamesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected