Split segment data update and edge update into sub-functions
This commit is contained in:
parent
17f8339aa6
commit
cec1f223e9
@ -316,12 +316,12 @@ void updaterSegmentData(const UpdaterConfig &config,
|
||||
}
|
||||
}
|
||||
|
||||
const auto save_geometries = [&]() {
|
||||
// Now save out the updated compressed geometries
|
||||
extractor::io::write(config.geometry_path, segment_data);
|
||||
};
|
||||
}
|
||||
|
||||
const auto save_datastore_names = [&]() {
|
||||
void saveDatasourcesNames(const UpdaterConfig &config)
|
||||
{
|
||||
extractor::Datasources sources;
|
||||
DatasourceID source = 0;
|
||||
sources.SetSourceName(source++, "lua profile");
|
||||
@ -335,10 +335,8 @@ void updaterSegmentData(const UpdaterConfig &config,
|
||||
}
|
||||
|
||||
extractor::io::write(config.datasource_names_path, sources);
|
||||
};
|
||||
|
||||
tbb::parallel_invoke(save_geometries, save_datastore_names);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Updater::NumNodesAndEdges Updater::LoadAndUpdateEdgeExpandedGraph() const
|
||||
@ -353,6 +351,8 @@ EdgeID
|
||||
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||
std::vector<EdgeWeight> &node_weights) const
|
||||
{
|
||||
TIMER_START(load_edges);
|
||||
|
||||
// Propagate profile properties to contractor configuration structure
|
||||
extractor::ProfileProperties profile_properties;
|
||||
storage::io::FileReader profile_properties_file(config.profile_properties_path,
|
||||
@ -433,7 +433,10 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
|
||||
|
||||
if (update_edge_weights)
|
||||
{
|
||||
TIMER_START(segment);
|
||||
updaterSegmentData(config, profile_properties, segment_speed_lookup);
|
||||
TIMER_STOP(segment);
|
||||
util::Log() << "Updating segment data took " << TIMER_MSEC(segment) << "ms.";
|
||||
}
|
||||
|
||||
std::vector<TurnPenalty> turn_weight_penalties;
|
||||
@ -601,7 +604,10 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
|
||||
}
|
||||
#endif
|
||||
|
||||
util::Log() << "Done reading edges";
|
||||
saveDatasourcesNames(config);
|
||||
|
||||
TIMER_STOP(load_edges);
|
||||
util::Log() << "Done reading edges in " << TIMER_MSEC(load_edges) << "ms.";
|
||||
return graph_header.max_edge_id;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user