Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatoly Serdtcev <serdtcev@maps.me>2019-01-24 12:54:03 +0300
committerSergey Yershov <syershov@maps.me>2019-01-31 14:04:45 +0300
commite8cc2081d1d651feaf57897ef8ce9c9b850d0ec8 (patch)
treef8db72b4ac99e53f6fe785ba85a2627a2053bcb7 /indexer
parentfb562f9ceb3e21278dbdb71e46159a5644e4472a (diff)
[indexer] Fix distance weight
Diffstat (limited to 'indexer')
-rw-r--r--indexer/locality_index.hpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/indexer/locality_index.hpp b/indexer/locality_index.hpp
index dc712bcca4..94ab4380bf 100644
--- a/indexer/locality_index.hpp
+++ b/indexer/locality_index.hpp
@@ -100,12 +100,10 @@ public:
return 1.0;
auto const cell = m2::CellId<DEPTH_LEVELS>::FromInt64(cellNumber, cellDepth);
- auto const distance = chebyshevDistance(cell.XY());
- auto const cellSize = 2 * cell.Radius();
- auto const roudDistance = (distance + cellSize - 1) / cellSize * cellSize;
- CHECK_GREATER(roudDistance, 1, ());
+ auto const distance = chebyshevDistance(cell.XY()) - cell.Radius();
+ CHECK_GREATER(distance, 0, ());
- return 1.0 / roudDistance;
+ return 1.0 / distance;
};
auto insertObject = [&] (int64_t cellNumber, uint64_t storedId) {