| 131 | |
| 132 | template <typename T> |
| 133 | std::vector<std::string> GetHonestAffiliations(T && t, IndexSharedPtr const & index) |
| 134 | { |
| 135 | std::vector<std::string> affiliations; |
| 136 | ankerl::unordered_dense::set<borders::CountryPolygons const *> countires; |
| 137 | ForEachPoint(t, [&](auto const & point) |
| 138 | { |
| 139 | std::vector<CountriesFilesIndexAffiliation::Value> values; |
| 140 | boost::geometry::index::query(*index, boost::geometry::index::covers(point), std::back_inserter(values)); |
| 141 | for (auto const & v : values) |
| 142 | { |
| 143 | if (v.second.size() == 1) |
| 144 | { |
| 145 | borders::CountryPolygons const & cp = v.second.front(); |
| 146 | if (countires.insert(&cp).second) |
| 147 | affiliations.emplace_back(cp.GetName()); |
| 148 | } |
| 149 | else |
| 150 | { |
| 151 | for (borders::CountryPolygons const & cp : v.second) |
| 152 | if (cp.Contains(point) && countires.insert(&cp).second) |
| 153 | affiliations.emplace_back(cp.GetName()); |
| 154 | } |
| 155 | } |
| 156 | }); |
| 157 | |
| 158 | return affiliations; |
| 159 | } |
| 160 | |
| 161 | template <typename T> |
| 162 | std::vector<std::string> GetAffiliations(T && t, IndexSharedPtr const & index) |
no test coverage detected