From 9f8d0539f7312b94ace42a5432b7a19c30eb0257 Mon Sep 17 00:00:00 2001 From: Anatoly Serdtcev Date: Thu, 26 Dec 2019 12:22:48 +0300 Subject: [PATCH] [indexer] Fix object covering --- geometry/covering_utils.hpp | 12 ++++++------ indexer/cell_id.hpp | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/geometry/covering_utils.hpp b/geometry/covering_utils.hpp index 70bda02..b2c5b05 100644 --- a/geometry/covering_utils.hpp +++ b/geometry/covering_utils.hpp @@ -78,12 +78,6 @@ template void CoverObject(IntersectF const & intersect, uint64_t cellPenaltyArea, CellIdContainerT & out, int cellDepth, CellId cell) { - if (cell.Level() == cellDepth - 1) - { - out.push_back(cell); - return; - } - uint64_t const cellArea = std::pow(uint64_t(1 << (cellDepth - 1 - cell.Level())), 2); CellObjectIntersection const intersection = intersect(cell); @@ -95,6 +89,12 @@ void CoverObject(IntersectF const & intersect, uint64_t cellPenaltyArea, CellIdC return; } + if (cell.Level() == cellDepth - 1) + { + out.push_back(cell); + return; + } + buffer_vector subdiv; for (uint8_t i = 0; i < 4; ++i) CoverObject(intersect, cellPenaltyArea, subdiv, cellDepth, cell.Child(i)); diff --git a/indexer/cell_id.hpp b/indexer/cell_id.hpp index 166b485..ab9fc20 100644 --- a/indexer/cell_id.hpp +++ b/indexer/cell_id.hpp @@ -11,11 +11,11 @@ using RectId = m2::CellId<19>; -// 24 is enough to have cell size < 2.5m * 2.5m for world. -constexpr int kGeoObjectsDepthLevels = 24; +// 23 is enough to have cell size < 10m * 10m for world. +constexpr int kGeoObjectsDepthLevels = 23; -// Cell size < 40m * 40m for world is good for regions. -constexpr int kRegionsDepthLevels = 20; +// Cell size < 150m * 150m for world is good for regions. +constexpr int kRegionsDepthLevels = 19; template class CellIdConverter