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

Function RetrieveGeometryFeaturesImpl

libs/search/retrieval.cpp:302–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302Retrieval::ExtendedFeatures RetrieveGeometryFeaturesImpl(MwmContext const & context,
303 base::Cancellable const & cancellable, m2::RectD const & rect,
304 int scale)
305{
306 EditedFeaturesHolder holder(context.GetId());
307
308 covering::Intervals coverage;
309 CoverRect(rect, scale, coverage);
310
311 vector<uint64_t> features;
312 vector<uint64_t> exactlyMatchedFeatures;
313
314 FeaturesCollector collector(cancellable, features, exactlyMatchedFeatures);
315
316 context.ForEachIndex(coverage, scale, collector);
317
318 holder.ForEachModifiedOrCreated([&](EditableMapObject const & emo, uint64_t index)
319 {
320 auto const center = emo.GetMercator();
321 if (rect.IsPointInside(center))
322 features.push_back(index);
323 });
324 return SortFeaturesAndBuildResult(std::move(features), std::move(exactlyMatchedFeatures));
325}
326
327template <typename T>
328struct RetrieveAddressFeaturesAdaptor

Callers 1

Calls 7

ForEachIndexMethod · 0.80
CoverRectFunction · 0.70
GetIdMethod · 0.45
IsPointInsideMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected