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

Method MatchCategories

libs/search/geocoder.cpp:900–926  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

898}
899
900void Geocoder::MatchCategories(BaseContext & ctx, bool aroundPivot)
901{
902 TRACE(MatchCategories);
903
904 auto features = ctx.m_features[0];
905
906 if (aroundPivot)
907 {
908 auto const pivotFeatures = RetrieveGeometryFeatures(*m_context, m_params.m_pivot, RectId::Pivot);
909 ViewportFilter filter(pivotFeatures, m_preRanker.Limit() /* threshold */);
910 features.m_features = filter.Filter(features.m_features);
911 features.m_exactMatchingFeatures = features.m_exactMatchingFeatures.Intersect(features.m_features);
912 }
913
914 // Features have been retrieved from the search index
915 // using the exact (non-fuzzy) matching and intersected
916 // with viewport, if needed. Every such feature is relevant.
917 features.ForEach([&](uint32_t featureId, bool exactMatch)
918 {
919 Model::Type type;
920 if (!GetTypeInGeocoding(ctx, featureId, type))
921 return;
922
923 EmitResult(ctx, {m_context->GetId(), featureId}, type, TokenRange(0, ctx.NumTokens()), nullptr /* geoParts */,
924 true /* allTokensUsed */, exactMatch);
925 });
926}
927
928void Geocoder::MatchRegions(BaseContext & ctx, Region::Type type)
929{

Callers

nothing calls this directly

Calls 7

LimitMethod · 0.80
NumTokensMethod · 0.80
TokenRangeClass · 0.70
FilterMethod · 0.45
IntersectMethod · 0.45
ForEachMethod · 0.45
GetIdMethod · 0.45

Tested by

no test coverage detected