Replace dynamic distance calculation for table plugin with pre-calculated distances on shortcuts, avoiding unpacking cost.
Adds approx 10% to total data size. Speeds up large table requests by 2 orders of magnitude. Co-authored-by: Kajari Ghosh <ghoshkaj@gmail.com>
This commit is contained in:
@@ -31,6 +31,7 @@ inline InputEdge MakeUnitEdge(const NodeID from, const NodeID to)
|
||||
to, // target
|
||||
1, // weight
|
||||
1, // duration
|
||||
1, // distance
|
||||
GeometryID{0, false}, // geometry_id
|
||||
false, // reversed
|
||||
NodeBasedEdgeClassification(), // default flags
|
||||
|
||||
@@ -47,6 +47,7 @@ BOOST_AUTO_TEST_CASE(simple_intersection_connectivity)
|
||||
to,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
GeometryID{0, false},
|
||||
!allowed,
|
||||
NodeBasedEdgeClassification(),
|
||||
@@ -174,6 +175,7 @@ BOOST_AUTO_TEST_CASE(roundabout_intersection_connectivity)
|
||||
to,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
GeometryID{0, false},
|
||||
!allowed,
|
||||
NodeBasedEdgeClassification{
|
||||
@@ -277,7 +279,7 @@ BOOST_AUTO_TEST_CASE(skip_degree_two_nodes)
|
||||
//
|
||||
const auto unit_edge = [](const NodeID from, const NodeID to, bool allowed) {
|
||||
return InputEdge{
|
||||
from, to, 1, 1, GeometryID{0, false}, !allowed, NodeBasedEdgeClassification{}, 0};
|
||||
from, to, 1, 1, 1, GeometryID{0, false}, !allowed, NodeBasedEdgeClassification{}, 0};
|
||||
};
|
||||
std::vector<InputEdge> edges = {unit_edge(0, 1, true), // 0
|
||||
unit_edge(1, 0, true),
|
||||
|
||||
Reference in New Issue
Block a user