| 678 | } |
| 679 | |
| 680 | void Geocoder::FillLocalityCandidates(BaseContext const & ctx, CBV const & filter, size_t const maxNumLocalities, |
| 681 | vector<Locality> & preLocalities) |
| 682 | { |
| 683 | // todo(@m) "food moscow" should be a valid categorial request. |
| 684 | if (m_params.IsCategorialRequest()) |
| 685 | { |
| 686 | preLocalities.clear(); |
| 687 | return; |
| 688 | } |
| 689 | |
| 690 | storage::CountryInfoGetter::RegionIdVec ids; |
| 691 | for (auto const & type : m_regions) |
| 692 | { |
| 693 | for (auto const & ranges : type) |
| 694 | for (auto const & regions : ranges.second) |
| 695 | ids.insert(ids.end(), regions.m_ids.begin(), regions.m_ids.end()); |
| 696 | } |
| 697 | base::SortUnique(ids); |
| 698 | |
| 699 | auto const belongsToMatchedRegion = [&](m2::PointD const & point) |
| 700 | { return m_infoGetter.BelongsToAnyRegion(point, ids); }; |
| 701 | |
| 702 | LocalityScorerDelegate delegate(*m_context, m_params, belongsToMatchedRegion, m_cancellable); |
| 703 | LocalityScorer scorer(m_params, m_params.m_pivot.Center(), delegate); |
| 704 | scorer.GetTopLocalities(m_context->GetId(), ctx, filter, maxNumLocalities, preLocalities); |
| 705 | } |
| 706 | |
| 707 | void Geocoder::CacheWorldLocalities() |
| 708 | { |
nothing calls this directly
no test coverage detected