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

Function CoverIntersection

libs/indexer/feature_covering.cpp:113–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112template <int DEPTH_LEVELS>
113std::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
135namespace covering

Callers 1

CoverFeatureFunction · 0.85

Calls 4

CoverObjectFunction · 0.85
ToInt64Method · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected