change simplified graph loader to return a list of coordinates

This commit is contained in:
Dennis Luxen 2014-07-04 17:19:01 +02:00
parent c3621edf9c
commit 08ca450c40

View File

@ -268,8 +268,10 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
return n; return n;
} }
template <typename EdgeT> template <typename EdgeT, typename CoordinateT>
NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, std::vector<EdgeT> &edge_list) NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream,
std::vector<EdgeT> &edge_list,
std::vector<CoordinateT> & coordinate_list)
{ {
const FingerPrint fingerprint_orig; const FingerPrint fingerprint_orig;
FingerPrint fingerprint_loaded; FingerPrint fingerprint_loaded;
@ -285,7 +287,6 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, std::vector<Edg
EdgeID m; EdgeID m;
short dir; // direction (0 = open, 1 = forward, 2+ = open) short dir; // direction (0 = open, 1 = forward, 2+ = open)
std::unordered_map<NodeID, NodeID> ext_to_int_id_map; std::unordered_map<NodeID, NodeID> ext_to_int_id_map;
std::vector<NodeInfo> int_to_ext_node_id_map;
input_stream.read((char *)&n, sizeof(NodeID)); input_stream.read((char *)&n, sizeof(NodeID));
SimpleLogger().Write() << "Importing n = " << n << " nodes "; SimpleLogger().Write() << "Importing n = " << n << " nodes ";
@ -293,7 +294,7 @@ NodeID readBinaryOSRMGraphFromStream(std::istream &input_stream, std::vector<Edg
for (NodeID i = 0; i < n; ++i) for (NodeID i = 0; i < n; ++i)
{ {
input_stream.read((char *)&current_node, sizeof(ExternalMemoryNode)); input_stream.read((char *)&current_node, sizeof(ExternalMemoryNode));
int_to_ext_node_id_map.emplace_back(current_node.lat, current_node.lon, current_node.node_id); coordinate_list.emplace_back(current_node.lat, current_node.lon);
ext_to_int_id_map.emplace(current_node.node_id, i); ext_to_int_id_map.emplace(current_node.node_id, i);
} }