Fix formating

This commit is contained in:
Patrick Niklaus
2018-03-22 18:26:40 +00:00
parent 993f5badf1
commit c0dd5d7c76
39 changed files with 244 additions and 149 deletions
+1 -1
View File
@@ -1,8 +1,8 @@
#include "util/static_rtree.hpp"
#include "extractor/edge_based_node_segment.hpp"
#include "extractor/query_node.hpp"
#include "extractor/files.hpp"
#include "extractor/packed_osm_ids.hpp"
#include "extractor/query_node.hpp"
#include "mocks/mock_datafacade.hpp"
#include "storage/io.hpp"
+16 -16
View File
@@ -536,21 +536,21 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
&scripting_environment,
weight_multiplier,
&conditional_restriction_map](
// what nodes will be used? In most cases this will be the id
// stored in the edge_data. In case of duplicated nodes (e.g.
// due to via-way restrictions), one/both of these might
// refer to a newly added edge based node
const auto edge_based_node_from,
const auto edge_based_node_to,
// the situation of the turn
const auto node_along_road_entering,
const auto node_based_edge_from,
const auto intersection_node,
const auto node_based_edge_to,
const auto &turn_angle,
const auto &road_legs_on_the_right,
const auto &road_legs_on_the_left,
const auto &edge_geometries) {
// what nodes will be used? In most cases this will be the id
// stored in the edge_data. In case of duplicated nodes (e.g.
// due to via-way restrictions), one/both of these might
// refer to a newly added edge based node
const auto edge_based_node_from,
const auto edge_based_node_to,
// the situation of the turn
const auto node_along_road_entering,
const auto node_based_edge_from,
const auto intersection_node,
const auto node_based_edge_to,
const auto &turn_angle,
const auto &road_legs_on_the_right,
const auto &road_legs_on_the_left,
const auto &edge_geometries) {
const auto node_restricted =
isRestricted(node_along_road_entering,
@@ -872,7 +872,7 @@ void EdgeBasedGraphFactory::GenerateEdgeExpandedEdges(
// TODO: this loop is not optimized - once we have a few
// overrides available, we should index this for faster
// lookups
for (auto &override : unresolved_maneuver_overrides)
for (auto & override : unresolved_maneuver_overrides)
{
for (auto &turn : override.turn_sequence)
{
+9 -8
View File
@@ -1,10 +1,10 @@
#include "extractor/extraction_containers.hpp"
#include "extractor/extraction_segment.hpp"
#include "extractor/extraction_way.hpp"
#include "extractor/files.hpp"
#include "extractor/name_table.hpp"
#include "extractor/restriction.hpp"
#include "extractor/serialization.hpp"
#include "extractor/name_table.hpp"
#include "extractor/files.hpp"
#include "util/coordinate_calculation.hpp"
@@ -165,7 +165,9 @@ void ExtractionContainers::WriteCharData(const std::string &file_name)
log << "writing street name index ... ";
TIMER_START(write_index);
files::writeNames(file_name, NameTable {NameTable::IndexedData (name_offsets.begin(), name_offsets.end(), name_char_data.begin())});
files::writeNames(file_name,
NameTable{NameTable::IndexedData(
name_offsets.begin(), name_offsets.end(), name_char_data.begin())});
TIMER_STOP(write_index);
log << "ok, after " << TIMER_SEC(write_index) << "s";
@@ -275,8 +277,8 @@ void ExtractionContainers::PrepareEdges(ScriptingEnvironment &scripting_environm
{
if (edge_iterator->result.osm_source_id < node_iterator->node_id)
{
util::Log(logDEBUG)
<< "Found invalid node reference " << edge_iterator->result.source;
util::Log(logDEBUG) << "Found invalid node reference "
<< edge_iterator->result.source;
edge_iterator->result.source = SPECIAL_NODEID;
++edge_iterator;
continue;
@@ -1031,9 +1033,8 @@ void ExtractionContainers::PrepareRestrictions()
// translate the turn from one segment onto another into a node restriction (the ways can
// only
// be connected at a single location)
auto const get_node_restriction_from_OSM_ids = [&](auto const from_id,
auto const to_id,
const OSMNodeID via_node) {
auto const get_node_restriction_from_OSM_ids = [&](
auto const from_id, auto const to_id, const OSMNodeID via_node) {
auto const from_segment_itr = referenced_ways.find(from_id);
if (from_segment_itr->second.way_id != from_id)
{
+12 -11
View File
@@ -1,5 +1,6 @@
#include "extractor/extractor.hpp"
#include "extractor/compressed_node_based_graph_edge.hpp"
#include "extractor/edge_based_edge.hpp"
#include "extractor/extraction_containers.hpp"
#include "extractor/extraction_node.hpp"
@@ -8,13 +9,12 @@
#include "extractor/extractor_callbacks.hpp"
#include "extractor/files.hpp"
#include "extractor/maneuver_override_relation_parser.hpp"
#include "extractor/name_table.hpp"
#include "extractor/node_based_graph_factory.hpp"
#include "extractor/raster_source.hpp"
#include "extractor/restriction_filter.hpp"
#include "extractor/restriction_parser.hpp"
#include "extractor/scripting_environment.hpp"
#include "extractor/name_table.hpp"
#include "extractor/compressed_node_based_graph_edge.hpp"
#include "guidance/files.hpp"
#include "guidance/guidance_processing.hpp"
@@ -170,7 +170,7 @@ void SetExcludableClasses(const ExtractorCallbacks::ClassesMap &classes_map,
}
}
std::vector<CompressedNodeBasedGraphEdge> toEdgeList(const util::NodeBasedDynamicGraph& graph)
std::vector<CompressedNodeBasedGraphEdge> toEdgeList(const util::NodeBasedDynamicGraph &graph)
{
std::vector<CompressedNodeBasedGraphEdge> edges;
edges.reserve(graph.GetNumberOfEdges());
@@ -188,7 +188,6 @@ std::vector<CompressedNodeBasedGraphEdge> toEdgeList(const util::NodeBasedDynami
return edges;
}
}
/**
@@ -288,7 +287,8 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
compressed_node_based_graph_writing.wait();
};
files::writeCompressedNodeBasedGraph(config.GetPath(".osrm.cnbg").string(), toEdgeList(node_based_graph));
files::writeCompressedNodeBasedGraph(config.GetPath(".osrm.cnbg").string(),
toEdgeList(node_based_graph));
node_based_graph_factory.GetCompressedEdges().PrintStatistics();
@@ -343,7 +343,8 @@ int Extractor::run(ScriptingEnvironment &scripting_environment)
util::Log() << "Saving edge-based node weights to file.";
TIMER_START(timer_write_node_weights);
extractor::files::writeEdgeBasedNodeWeights(config.GetPath(".osrm.enw"), 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) << ")";
@@ -558,9 +559,9 @@ Extractor::ParseOSMData(ScriptingEnvironment &scripting_environment,
const auto &rel = static_cast<const osmium::Relation &>(*entity);
const char *rel_type = rel.get_value_by_key("type");
if (!rel_type || !std::binary_search(relation_types.begin(),
relation_types.end(),
std::string(rel_type)))
if (!rel_type ||
!std::binary_search(
relation_types.begin(), relation_types.end(), std::string(rel_type)))
continue;
ExtractionRelation extracted_rel({rel.id(), osmium::item_type::relation});
@@ -823,8 +824,8 @@ void Extractor::BuildRTree(std::vector<EdgeBasedNodeSegment> edge_based_node_seg
edge_based_node_segments.resize(new_size);
TIMER_START(construction);
util::StaticRTree<EdgeBasedNodeSegment> rtree(edge_based_node_segments, coordinates,
config.GetPath(".osrm.fileIndex"));
util::StaticRTree<EdgeBasedNodeSegment> rtree(
edge_based_node_segments, coordinates, config.GetPath(".osrm.fileIndex"));
files::writeRamIndex(config.GetPath(".osrm.ramIndex"), rtree);
@@ -1,9 +1,9 @@
#include "extractor/intersection/mergable_road_detector.hpp"
#include "extractor/intersection/intersection_analysis.hpp"
#include "extractor/intersection/node_based_graph_walker.hpp"
#include "extractor/name_table.hpp"
#include "extractor/query_node.hpp"
#include "extractor/suffix_table.hpp"
#include "extractor/name_table.hpp"
#include "guidance/constants.hpp"
#include "util/bearing.hpp"
+8 -2
View File
@@ -1,6 +1,6 @@
#include "extractor/node_based_graph_factory.hpp"
#include "extractor/graph_compressor.hpp"
#include "extractor/files.hpp"
#include "extractor/graph_compressor.hpp"
#include "storage/io.hpp"
#include "util/log.hpp"
@@ -38,7 +38,13 @@ void NodeBasedGraphFactory::LoadDataFromFile(const boost::filesystem::path &inpu
auto traffic_signals_iter = inserter(traffic_signals, end(traffic_signals));
std::vector<NodeBasedEdge> edge_list;
files::readRawNBGraph(input_file, barriers_iter, traffic_signals_iter, coordinates, osm_node_ids, edge_list, annotation_data);
files::readRawNBGraph(input_file,
barriers_iter,
traffic_signals_iter,
coordinates,
osm_node_ids,
edge_list,
annotation_data);
const auto number_of_node_based_nodes = coordinates.size();
if (edge_list.empty())
+7 -9
View File
@@ -162,10 +162,8 @@ updateSegmentData(const UpdaterConfig &config,
// closure to convert SpeedSource value to weight and count fallbacks to durations
std::atomic<std::uint32_t> fallbacks_to_duration{0};
auto convertToWeight = [&profile_properties,
&fallbacks_to_duration](const SegmentWeight &existing_weight,
const SpeedSource &value,
double distance_in_meters) {
auto convertToWeight = [&profile_properties, &fallbacks_to_duration](
const SegmentWeight &existing_weight, const SpeedSource &value, double distance_in_meters) {
double rate = std::numeric_limits<double>::quiet_NaN();
@@ -440,8 +438,8 @@ updateTurnPenalties(const UpdaterConfig &config,
{
auto map =
util::mmapTarFile(config.GetPath(".osrm.turn_penalties_index"), turn_index_region);
turn_index_blocks =
reinterpret_cast<const extractor::lookup::TurnIndexBlock *>(map["/extractor/turn_index"].first);
turn_index_blocks = reinterpret_cast<const extractor::lookup::TurnIndexBlock *>(
map["/extractor/turn_index"].first);
}
// Get the turn penalty and update to the new value if required
@@ -770,9 +768,9 @@ Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &e
{
if (turn_weight_penalty < 0)
{
util::Log(logWARNING)
<< "turn penalty " << turn_weight_penalty
<< " is too negative: clamping turn weight to " << weight_min_value;
util::Log(logWARNING) << "turn penalty " << turn_weight_penalty
<< " is too negative: clamping turn weight to "
<< weight_min_value;
turn_weight_penalty = weight_min_value - new_weight;
turn_weight_penalties[edge.data.turn_id] = turn_weight_penalty;
}