Skip to content

Commit 342403b

Browse files
authored
Merge pull request #1541 from joto/fix-node-location-store
Bugfix: Nodes not stored in node location store correctly
2 parents 75d41a0 + 284a3e6 commit 342403b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/ordered-index.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ void ordered_index_t::add(osmid_t id, std::size_t offset)
1919
(last().offset_from + last().index.back().offset) < offset));
2020

2121
if (need_new_2nd_level() ||
22-
(id - last().from) > std::numeric_limits<uint32_t>::max()) {
22+
(id - last().from) > std::numeric_limits<uint32_t>::max() ||
23+
(offset - last().offset_from) >= std::numeric_limits<uint32_t>::max()) {
2324
if (!m_ranges.empty()) {
2425
m_ranges.back().to = id - 1;
2526
}

src/ordered-index.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* An index that is never used doesn't need more memory than
3232
* sizeof(ordered_index_t).
3333
*
34-
* All allocated memory can be freed by calling clear(). Afer that the index
34+
* All allocated memory can be freed by calling clear(). After that the index
3535
* can NOT be reused.
3636
*
3737
* There are two ways of accessing the data through the index:
@@ -185,7 +185,7 @@ class ordered_index_t
185185

186186
std::pair<osmid_t, std::size_t> get_internal(osmid_t id) const noexcept;
187187

188-
static constexpr std::size_t const max_block_size = 16 * 1024 * 1204;
188+
static constexpr std::size_t const max_block_size = 16 * 1024 * 1024;
189189

190190
std::vector<range_entry> m_ranges;
191191
std::size_t m_block_size;

0 commit comments

Comments
 (0)