Port .enw file to tar format
This commit is contained in:
parent
b8260e44fa
commit
2b010fc6f3
@ -439,6 +439,24 @@ void writeNames(const boost::filesystem::path &path, const NameTableT &table)
|
||||
|
||||
serialization::write(writer, "/common/names", table);
|
||||
}
|
||||
|
||||
template <typename NodeWeigtsVectorT>
|
||||
void readEdgeBasedNodeWeights(const boost::filesystem::path &path, NodeWeigtsVectorT &weights)
|
||||
{
|
||||
const auto fingerprint = storage::tar::FileReader::VerifyFingerprint;
|
||||
storage::tar::FileReader reader{path, fingerprint};
|
||||
|
||||
storage::serialization::read(reader, "/extractor/edge_based_node_weights", weights);
|
||||
}
|
||||
|
||||
template <typename NodeWeigtsVectorT>
|
||||
void writeEdgeBasedNodeWeights(const boost::filesystem::path &path, const NodeWeigtsVectorT &weights)
|
||||
{
|
||||
const auto fingerprint = storage::tar::FileWriter::GenerateFingerprint;
|
||||
storage::tar::FileWriter writer{path, fingerprint};
|
||||
|
||||
storage::serialization::write(writer, "/extractor/edge_based_node_weights", weights);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,11 +63,7 @@ int Contractor::Run()
|
||||
|
||||
util::Log() << "Reading node weights.";
|
||||
std::vector<EdgeWeight> node_weights;
|
||||
{
|
||||
storage::io::FileReader reader(config.GetPath(".osrm.enw"),
|
||||
storage::io::FileReader::VerifyFingerprint);
|
||||
storage::serialization::read(reader, node_weights);
|
||||
}
|
||||
extractor::files::readEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), node_weights);
|
||||
util::Log() << "Done reading node weights.";
|
||||
|
||||
util::Log() << "Loading edge-expanded graph representation";
|
||||
|
@ -325,11 +325,7 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
|
||||
|
||||
util::Log() << "Saving edge-based node weights to file.";
|
||||
TIMER_START(timer_write_node_weights);
|
||||
{
|
||||
storage::io::FileWriter writer(config.GetPath(".osrm.enw"),
|
||||
storage::io::FileWriter::GenerateFingerprint);
|
||||
storage::serialization::write(writer, edge_based_node_weights);
|
||||
}
|
||||
extractor::files::writeEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), edge_based_node_weights);
|
||||
TIMER_STOP(timer_write_node_weights);
|
||||
util::Log() << "Done writing. (" << TIMER_SEC(timer_write_node_weights) << ")";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user