| 113 | } |
| 114 | |
| 115 | std::optional<std::string> IsOneCountryForLimitRect(m2::RectD const & limitRect, IndexSharedPtr const & index) |
| 116 | { |
| 117 | borders::CountryPolygons const * country = nullptr; |
| 118 | std::vector<CountriesFilesIndexAffiliation::Value> values; |
| 119 | auto const bbox = MakeBox(limitRect); |
| 120 | boost::geometry::index::query(*index, boost::geometry::index::covers(bbox), std::back_inserter(values)); |
| 121 | for (auto const & v : values) |
| 122 | { |
| 123 | for (borders::CountryPolygons const & c : v.second) |
| 124 | if (!country) |
| 125 | country = &c; |
| 126 | else if (country != &c) |
| 127 | return {}; |
| 128 | } |
| 129 | return country ? country->GetName() : std::optional<std::string>{}; |
| 130 | } |
| 131 | |
| 132 | template <typename T> |
| 133 | std::vector<std::string> GetHonestAffiliations(T && t, IndexSharedPtr const & index) |
no test coverage detected