| 111 | |
| 112 | template <int DEPTH_LEVELS> |
| 113 | std::vector<int64_t> CoverIntersection(FeatureIntersector<DEPTH_LEVELS> const & fIsect, int cellDepth, |
| 114 | uint64_t cellPenaltyArea) |
| 115 | { |
| 116 | if (fIsect.m_trg.empty() && fIsect.m_polyline.size() == 1) |
| 117 | { |
| 118 | m2::PointD const pt = fIsect.m_polyline[0]; |
| 119 | return std::vector<int64_t>( |
| 120 | 1, m2::CellId<DEPTH_LEVELS>::FromXY(static_cast<uint32_t>(pt.x), static_cast<uint32_t>(pt.y), DEPTH_LEVELS - 1) |
| 121 | .ToInt64(cellDepth)); |
| 122 | } |
| 123 | |
| 124 | std::vector<m2::CellId<DEPTH_LEVELS>> cells; |
| 125 | covering::CoverObject(fIsect, cellPenaltyArea, cells, cellDepth, m2::CellId<DEPTH_LEVELS>::Root()); |
| 126 | |
| 127 | std::vector<int64_t> res(cells.size()); |
| 128 | for (size_t i = 0; i < cells.size(); ++i) |
| 129 | res[i] = cells[i].ToInt64(cellDepth); |
| 130 | |
| 131 | return res; |
| 132 | } |
| 133 | } // namespace |
| 134 | |
| 135 | namespace covering |
no test coverage detected