Change StaticRTree serialization constructor to static function

Since the constructor does not satisfy the requirements for a
constructor (the RTree is not properly initialized) make it a
static function instead.
This commit is contained in:
Patrick Niklaus
2014-06-28 20:42:48 +02:00
parent 8f05fc0a84
commit a3dd9c3e57
3 changed files with 25 additions and 34 deletions
+4 -14
View File
@@ -170,7 +170,10 @@ int Prepare::Process(int argc, char *argv[])
TIMER_STOP(expansion);
BuildRTree(node_based_edge_list);
StaticRTree<EdgeBasedNode>::Build(node_based_edge_list,
rtree_nodes_path.c_str(),
rtree_leafs_path.c_str(),
internal_to_external_node_map);
IteratorbasedCRC32<std::vector<EdgeBasedNode>> crc32;
const unsigned node_based_edge_list_CRC32 =
@@ -544,16 +547,3 @@ void Prepare::WriteNodeMapping()
internal_to_external_node_map.shrink_to_fit();
}
/**
\brief Building rtree-based nearest-neighbor data structure
Saves info to files: '.ramIndex' and '.fileIndex'.
*/
void Prepare::BuildRTree(std::vector<EdgeBasedNode> &node_based_edge_list)
{
SimpleLogger().Write() << "building r-tree ...";
StaticRTree<EdgeBasedNode>(node_based_edge_list,
rtree_nodes_path.c_str(),
rtree_leafs_path.c_str(),
internal_to_external_node_map);
}
-1
View File
@@ -40,7 +40,6 @@ class Prepare
DeallocatingVector<EdgeBasedEdge> &edgeBasedEdgeList,
EdgeBasedGraphFactory::SpeedProfileProperties &speed_profile);
void WriteNodeMapping();
void BuildRTree(std::vector<EdgeBasedNode> &node_based_edge_list);
private:
std::vector<NodeInfo> internal_to_external_node_map;