Recreate feature/expose_node_ids

This commit is contained in:
Lauren Budorick
2016-05-18 16:09:14 -04:00
committed by Daniel J. Hofmann
parent 448f8377fb
commit a4ac07866a
10 changed files with 59 additions and 0 deletions
+6
View File
@@ -244,6 +244,9 @@ int Storage::Run()
nodes_input_stream.read((char *)&coordinate_list_size, sizeof(unsigned));
shared_layout_ptr->SetBlockSize<util::Coordinate>(SharedDataLayout::COORDINATE_LIST,
coordinate_list_size);
// we'll read a list of OSM node IDs from the same data, so set the same block size:
shared_layout_ptr->SetBlockSize<OSMNodeID>(SharedDataLayout::OSM_NODE_ID_LIST,
coordinate_list_size);
// load geometries sizes
boost::filesystem::ifstream geometry_input_stream(config.geometries_path, std::ios::binary);
@@ -535,12 +538,15 @@ int Storage::Run()
// Loading list of coordinates
util::Coordinate *coordinates_ptr = shared_layout_ptr->GetBlockPtr<util::Coordinate, true>(
shared_memory_ptr, SharedDataLayout::COORDINATE_LIST);
OSMNodeID *osmnodeid_ptr = shared_layout_ptr->GetBlockPtr<OSMNodeID, true>(
shared_memory_ptr, SharedDataLayout::OSM_NODE_ID_LIST);
extractor::QueryNode current_node;
for (unsigned i = 0; i < coordinate_list_size; ++i)
{
nodes_input_stream.read((char *)&current_node, sizeof(extractor::QueryNode));
coordinates_ptr[i] = util::Coordinate(current_node.lon, current_node.lat);
osmnodeid_ptr[i] = OSMNodeID(current_node.node_id);
}
nodes_input_stream.close();