[skip ci] Fix formating using format.sh
This commit is contained in:
parent
9435254661
commit
f02b7b0910
@ -74,8 +74,7 @@ util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end)
|
|||||||
|
|
||||||
util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver);
|
util::json::Object makeStepManeuver(const guidance::StepManeuver &maneuver);
|
||||||
|
|
||||||
util::json::Object makeRouteStep(guidance::RouteStep step,
|
util::json::Object makeRouteStep(guidance::RouteStep step, util::json::Value geometry);
|
||||||
util::json::Value geometry);
|
|
||||||
|
|
||||||
util::json::Object makeRoute(const guidance::Route &route,
|
util::json::Object makeRoute(const guidance::Route &route,
|
||||||
util::json::Array legs,
|
util::json::Array legs,
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
#include "util/guidance/turn_lanes.hpp"
|
#include "util/guidance/turn_lanes.hpp"
|
||||||
|
|
||||||
#include "engine/geospatial_query.hpp"
|
#include "engine/geospatial_query.hpp"
|
||||||
#include "util/packed_vector.hpp"
|
|
||||||
#include "util/guidance/turn_bearing.hpp"
|
#include "util/guidance/turn_bearing.hpp"
|
||||||
|
#include "util/packed_vector.hpp"
|
||||||
#include "util/range_table.hpp"
|
#include "util/range_table.hpp"
|
||||||
#include "util/rectangle.hpp"
|
#include "util/rectangle.hpp"
|
||||||
#include "util/simple_logger.hpp"
|
#include "util/simple_logger.hpp"
|
||||||
|
@ -31,7 +31,8 @@ class ViaRoutePlugin final : public BasePlugin
|
|||||||
mutable SearchEngineData heaps;
|
mutable SearchEngineData heaps;
|
||||||
mutable routing_algorithms::ShortestPathRouting<datafacade::BaseDataFacade> shortest_path;
|
mutable routing_algorithms::ShortestPathRouting<datafacade::BaseDataFacade> shortest_path;
|
||||||
mutable routing_algorithms::AlternativeRouting<datafacade::BaseDataFacade> alternative_path;
|
mutable routing_algorithms::AlternativeRouting<datafacade::BaseDataFacade> alternative_path;
|
||||||
mutable routing_algorithms::DirectShortestPathRouting<datafacade::BaseDataFacade> direct_shortest_path;
|
mutable routing_algorithms::DirectShortestPathRouting<datafacade::BaseDataFacade>
|
||||||
|
direct_shortest_path;
|
||||||
const int max_locations_viaroute;
|
const int max_locations_viaroute;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -843,8 +843,7 @@ class AlternativeRouting final
|
|||||||
const NodeID via_path_middle_node_id = current_edge_data.id;
|
const NodeID via_path_middle_node_id = current_edge_data.id;
|
||||||
const EdgeID second_segment_edge_id =
|
const EdgeID second_segment_edge_id =
|
||||||
facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second);
|
facade.FindEdgeInEitherDirection(via_path_middle_node_id, via_path_edge.second);
|
||||||
const int second_segment_length =
|
const int second_segment_length = facade.GetEdgeData(second_segment_edge_id).weight;
|
||||||
facade.GetEdgeData(second_segment_edge_id).weight;
|
|
||||||
// attention: !unpacking in reverse!
|
// attention: !unpacking in reverse!
|
||||||
// Check if second segment is the one to go over treshold? if yes add second segment
|
// Check if second segment is the one to go over treshold? if yes add second segment
|
||||||
// to stack, else push first segment to stack and add weight of second one.
|
// to stack, else push first segment to stack and add weight of second one.
|
||||||
|
@ -81,10 +81,10 @@ inline HSGRHeader readHSGRHeader(boost::filesystem::ifstream &input_stream)
|
|||||||
using NodeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::NodeArrayEntry;
|
using NodeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::NodeArrayEntry;
|
||||||
using EdgeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::EdgeArrayEntry;
|
using EdgeT = typename util::StaticGraph<contractor::QueryEdge::EdgeData>::EdgeArrayEntry;
|
||||||
inline void readHSGR(boost::filesystem::ifstream &input_stream,
|
inline void readHSGR(boost::filesystem::ifstream &input_stream,
|
||||||
NodeT *node_buffer,
|
NodeT *node_buffer,
|
||||||
const std::uint64_t number_of_nodes,
|
const std::uint64_t number_of_nodes,
|
||||||
EdgeT *edge_buffer,
|
EdgeT *edge_buffer,
|
||||||
const std::uint64_t number_of_edges)
|
const std::uint64_t number_of_edges)
|
||||||
{
|
{
|
||||||
BOOST_ASSERT(node_buffer);
|
BOOST_ASSERT(node_buffer);
|
||||||
BOOST_ASSERT(edge_buffer);
|
BOOST_ASSERT(edge_buffer);
|
||||||
@ -177,7 +177,6 @@ void readNodes(boost::filesystem::ifstream &nodes_input_stream,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reads datasource names out of .datasource_names files and metadata such as
|
// Reads datasource names out of .datasource_names files and metadata such as
|
||||||
// the length and offset of each name
|
// the length and offset of each name
|
||||||
struct DatasourceNamesData
|
struct DatasourceNamesData
|
||||||
@ -186,7 +185,8 @@ struct DatasourceNamesData
|
|||||||
std::vector<std::size_t> offsets;
|
std::vector<std::size_t> offsets;
|
||||||
std::vector<std::size_t> lengths;
|
std::vector<std::size_t> lengths;
|
||||||
};
|
};
|
||||||
inline DatasourceNamesData readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream)
|
inline DatasourceNamesData
|
||||||
|
readDatasourceNames(boost::filesystem::ifstream &datasource_names_input_stream)
|
||||||
{
|
{
|
||||||
DatasourceNamesData datasource_names_data;
|
DatasourceNamesData datasource_names_data;
|
||||||
std::string name;
|
std::string name;
|
||||||
@ -215,7 +215,6 @@ void readRamIndex(boost::filesystem::ifstream &ram_index_input_stream,
|
|||||||
ram_index_input_stream.read(reinterpret_cast<char *>(rtree_buffer),
|
ram_index_input_stream.read(reinterpret_cast<char *>(rtree_buffer),
|
||||||
sizeof(RTreeNodeT) * tree_size);
|
sizeof(RTreeNodeT) * tree_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,14 +23,8 @@ struct SharedBarriers
|
|||||||
{
|
{
|
||||||
boost::interprocess::named_sharable_mutex::remove("current_regions");
|
boost::interprocess::named_sharable_mutex::remove("current_regions");
|
||||||
}
|
}
|
||||||
static void resetRegions1()
|
static void resetRegions1() { boost::interprocess::named_sharable_mutex::remove("regions_1"); }
|
||||||
{
|
static void resetRegions2() { boost::interprocess::named_sharable_mutex::remove("regions_2"); }
|
||||||
boost::interprocess::named_sharable_mutex::remove("regions_1");
|
|
||||||
}
|
|
||||||
static void resetRegions2()
|
|
||||||
{
|
|
||||||
boost::interprocess::named_sharable_mutex::remove("regions_2");
|
|
||||||
}
|
|
||||||
|
|
||||||
boost::interprocess::named_upgradable_mutex current_regions_mutex;
|
boost::interprocess::named_upgradable_mutex current_regions_mutex;
|
||||||
boost::interprocess::named_sharable_mutex regions_1_mutex;
|
boost::interprocess::named_sharable_mutex regions_1_mutex;
|
||||||
|
@ -147,7 +147,6 @@ NodeID loadEdgesFromFile(std::istream &input_stream,
|
|||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
#include "util/group_by.hpp"
|
#include "util/group_by.hpp"
|
||||||
#include "util/guidance/toolkit.hpp"
|
#include "util/guidance/toolkit.hpp"
|
||||||
|
|
||||||
|
#include "extractor/guidance/toolkit.hpp"
|
||||||
#include "extractor/guidance/turn_instruction.hpp"
|
#include "extractor/guidance/turn_instruction.hpp"
|
||||||
#include "engine/guidance/post_processing.hpp"
|
#include "engine/guidance/post_processing.hpp"
|
||||||
#include "extractor/guidance/toolkit.hpp"
|
|
||||||
|
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
@ -132,7 +132,8 @@ Status MatchPlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFaca
|
|||||||
|
|
||||||
if (!time_increases_monotonically)
|
if (!time_increases_monotonically)
|
||||||
{
|
{
|
||||||
return Error("InvalidValue", "Timestamps need to be monotonically increasing.", json_result);
|
return Error(
|
||||||
|
"InvalidValue", "Timestamps need to be monotonically increasing.", json_result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// assuming radius is the standard deviation of a normal distribution
|
// assuming radius is the standard deviation of a normal distribution
|
||||||
|
@ -606,7 +606,8 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
for (const auto &edge : edges)
|
for (const auto &edge : edges)
|
||||||
{
|
{
|
||||||
|
|
||||||
const auto forward_datasource_vector = facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
|
const auto forward_datasource_vector =
|
||||||
|
facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
|
||||||
const auto reverse_datasource_vector =
|
const auto reverse_datasource_vector =
|
||||||
facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
|
facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
|
||||||
|
|
||||||
@ -614,8 +615,7 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
|
const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
|
||||||
BOOST_ASSERT(edge.fwd_segment_position < reverse_datasource_vector.size());
|
BOOST_ASSERT(edge.fwd_segment_position < reverse_datasource_vector.size());
|
||||||
const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() -
|
const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() -
|
||||||
edge.fwd_segment_position - 1];
|
edge.fwd_segment_position - 1];
|
||||||
|
|
||||||
|
|
||||||
// Keep track of the highest datasource seen so that we don't write unnecessary
|
// Keep track of the highest datasource seen so that we don't write unnecessary
|
||||||
// data to the layer attribute values
|
// data to the layer attribute values
|
||||||
@ -655,16 +655,26 @@ Status TilePlugin::HandleRequest(const std::shared_ptr<datafacade::BaseDataFacad
|
|||||||
const auto a = facade->GetCoordinateOfNode(edge.u);
|
const auto a = facade->GetCoordinateOfNode(edge.u);
|
||||||
const auto b = facade->GetCoordinateOfNode(edge.v);
|
const auto b = facade->GetCoordinateOfNode(edge.v);
|
||||||
// Calculate the length in meters
|
// Calculate the length in meters
|
||||||
const double length = osrm::util::coordinate_calculation::haversineDistance(a, b);
|
const double length =
|
||||||
|
osrm::util::coordinate_calculation::haversineDistance(a, b);
|
||||||
|
|
||||||
const auto forward_weight_vector = facade->GetUncompressedForwardWeights(edge.packed_geometry_id);
|
const auto forward_weight_vector =
|
||||||
const auto reverse_weight_vector = facade->GetUncompressedReverseWeights(edge.packed_geometry_id);
|
facade->GetUncompressedForwardWeights(edge.packed_geometry_id);
|
||||||
const auto forward_datasource_vector = facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
|
const auto reverse_weight_vector =
|
||||||
const auto reverse_datasource_vector = facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
|
facade->GetUncompressedReverseWeights(edge.packed_geometry_id);
|
||||||
|
const auto forward_datasource_vector =
|
||||||
|
facade->GetUncompressedForwardDatasources(edge.packed_geometry_id);
|
||||||
|
const auto reverse_datasource_vector =
|
||||||
|
facade->GetUncompressedReverseDatasources(edge.packed_geometry_id);
|
||||||
const auto forward_weight = forward_weight_vector[edge.fwd_segment_position];
|
const auto forward_weight = forward_weight_vector[edge.fwd_segment_position];
|
||||||
const auto reverse_weight = reverse_weight_vector[reverse_weight_vector.size() - edge.fwd_segment_position - 1];
|
const auto reverse_weight =
|
||||||
const auto forward_datasource = forward_datasource_vector[edge.fwd_segment_position];
|
reverse_weight_vector[reverse_weight_vector.size() -
|
||||||
const auto reverse_datasource = reverse_datasource_vector[reverse_datasource_vector.size() - edge.fwd_segment_position - 1];
|
edge.fwd_segment_position - 1];
|
||||||
|
const auto forward_datasource =
|
||||||
|
forward_datasource_vector[edge.fwd_segment_position];
|
||||||
|
const auto reverse_datasource =
|
||||||
|
reverse_datasource_vector[reverse_datasource_vector.size() -
|
||||||
|
edge.fwd_segment_position - 1];
|
||||||
|
|
||||||
use_line_value(reverse_weight);
|
use_line_value(reverse_weight);
|
||||||
use_line_value(forward_weight);
|
use_line_value(forward_weight);
|
||||||
|
@ -98,7 +98,7 @@ struct CmpEdgeByInternalSourceTargetAndName
|
|||||||
value_type max_value() { return value_type::max_internal_value(); }
|
value_type max_value() { return value_type::max_internal_value(); }
|
||||||
value_type min_value() { return value_type::min_internal_value(); }
|
value_type min_value() { return value_type::min_internal_value(); }
|
||||||
|
|
||||||
std::mutex& mutex;
|
std::mutex &mutex;
|
||||||
const oe::ExtractionContainers::STXXLNameCharData &name_data;
|
const oe::ExtractionContainers::STXXLNameCharData &name_data;
|
||||||
const oe::ExtractionContainers::STXXLNameOffsets &name_offsets;
|
const oe::ExtractionContainers::STXXLNameOffsets &name_offsets;
|
||||||
};
|
};
|
||||||
|
@ -22,9 +22,10 @@ bool generateDataStoreOptions(const int argc,
|
|||||||
// declare a group of options that will be allowed both on command line
|
// declare a group of options that will be allowed both on command line
|
||||||
// as well as in a config file
|
// as well as in a config file
|
||||||
boost::program_options::options_description config_options("Configuration");
|
boost::program_options::options_description config_options("Configuration");
|
||||||
config_options.add_options()("max-wait",
|
config_options.add_options()(
|
||||||
boost::program_options::value<int>(&max_wait)->default_value(-1),
|
"max-wait",
|
||||||
"Maximum number of seconds to wait on requests that use the old dataset.");
|
boost::program_options::value<int>(&max_wait)->default_value(-1),
|
||||||
|
"Maximum number of seconds to wait on requests that use the old dataset.");
|
||||||
|
|
||||||
// hidden options, will be allowed on command line but will not be shown to the user
|
// hidden options, will be allowed on command line but will not be shown to the user
|
||||||
boost::program_options::options_description hidden_options("Hidden options");
|
boost::program_options::options_description hidden_options("Hidden options");
|
||||||
@ -110,11 +111,12 @@ int main(const int argc, const char *argv[]) try
|
|||||||
const constexpr unsigned MAX_RETRIES = 3;
|
const constexpr unsigned MAX_RETRIES = 3;
|
||||||
unsigned retry_counter = 0;
|
unsigned retry_counter = 0;
|
||||||
storage::Storage::ReturnCode code = storage::Storage::ReturnCode::Retry;
|
storage::Storage::ReturnCode code = storage::Storage::ReturnCode::Retry;
|
||||||
while(code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES)
|
while (code == storage::Storage::ReturnCode::Retry && retry_counter < MAX_RETRIES)
|
||||||
{
|
{
|
||||||
if (retry_counter > 0)
|
if (retry_counter > 0)
|
||||||
{
|
{
|
||||||
util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter+1) << " to load the dataset.";
|
util::SimpleLogger().Write(logWARNING) << "Try number " << (retry_counter + 1)
|
||||||
|
<< " to load the dataset.";
|
||||||
}
|
}
|
||||||
code = storage.Run(max_wait);
|
code = storage.Run(max_wait);
|
||||||
retry_counter++;
|
retry_counter++;
|
||||||
|
Loading…
Reference in New Issue
Block a user