Skip to content

Commit

Permalink
Refactor RTree so that .fileIndex only contains EdgeDataT, and all r-…
Browse files Browse the repository at this point in the history
…tree structure is in the .ramIndex file.

Also tunes the BRANCHING_FACTOR a bit to speed up access with this new layout.
  • Loading branch information
danpat committed May 25, 2017
1 parent 314cf3f commit 4a7d015
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,15 @@ class ContiguousInternalMemoryDataFacadeBase : public BaseDataFacade
"Is any data loaded into shared memory?" + SOURCE_REF);
}

auto tree_ptr =
auto tree_nodes_ptr =
data_layout.GetBlockPtr<RTreeNode>(memory_block, storage::DataLayout::R_SEARCH_TREE);
auto tree_level_sizes_ptr = data_layout.GetBlockPtr<std::uint64_t>(
memory_block, storage::DataLayout::R_SEARCH_TREE_LEVELS);
m_static_rtree.reset(
new SharedRTree(tree_ptr,
new SharedRTree(tree_nodes_ptr,
data_layout.num_entries[storage::DataLayout::R_SEARCH_TREE],
tree_level_sizes_ptr,
data_layout.num_entries[storage::DataLayout::R_SEARCH_TREE_LEVELS],
file_index_path,
m_coordinate_list));
m_geospatial_query.reset(
Expand Down
2 changes: 2 additions & 0 deletions include/storage/shared_datatype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const constexpr char *block_id_to_name[] = {"NAME_CHAR_DATA",
"TURN_INSTRUCTION",
"ENTRY_CLASSID",
"R_SEARCH_TREE",
"R_SEARCH_TREE_LEVELS",
"GEOMETRIES_INDEX",
"GEOMETRIES_NODE_LIST",
"GEOMETRIES_FWD_WEIGHT_LIST",
Expand Down Expand Up @@ -84,6 +85,7 @@ struct DataLayout
TURN_INSTRUCTION,
ENTRY_CLASSID,
R_SEARCH_TREE,
R_SEARCH_TREE_LEVELS,
GEOMETRIES_INDEX,
GEOMETRIES_NODE_LIST,
GEOMETRIES_FWD_WEIGHT_LIST,
Expand Down
9 changes: 6 additions & 3 deletions include/util/rectangle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ struct RectangleInt2D
};
inline std::ostream &operator<<(std::ostream &out, const RectangleInt2D &rect)
{
out << std::setprecision(12) << "(" << toFloating(rect.min_lon) << ","
<< toFloating(rect.max_lon) << "," << toFloating(rect.min_lat) << ","
<< toFloating(rect.max_lat) << ")";
out << std::setprecision(12) << "[[" << toFloating(rect.min_lon) << ","
<< toFloating(rect.min_lat) << "],[" << toFloating(rect.min_lon) << ","
<< toFloating(rect.max_lat) << "],[" << toFloating(rect.max_lon) << ","
<< toFloating(rect.max_lat) << "],[" << toFloating(rect.max_lon) << ","
<< toFloating(rect.min_lat) << "],[" << toFloating(rect.min_lon) << ","
<< toFloating(rect.min_lat) << "]";
return out;
}
}
Expand Down
Loading

0 comments on commit 4a7d015

Please sign in to comment.