From 415f8ef2d83df4e7551b9cd771fe3add798722d8 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 8 Oct 2014 11:01:33 +0200 Subject: [PATCH 1/2] add test-case for bug --- features/testbot/compression.feature | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 features/testbot/compression.feature diff --git a/features/testbot/compression.feature b/features/testbot/compression.feature new file mode 100644 index 000000000..12c1219a0 --- /dev/null +++ b/features/testbot/compression.feature @@ -0,0 +1,22 @@ +@routing @graph +Feature: Geometry Compression + + Background: + Given the profile "testbot" + + Scenario: Compressed segments have correct order + Given the node map + | a | | d | | | | h | + | b | | | | e | | f | + | | c | | | | | g | + + And the ways + | nodes | + | abcdef | + | fh | + | fg | + + When I route I should get + | from | to | route | distance | speed | + | b | e | abcdef | 589m | 35 km/h | + | e | b | abcdef | 589m | 35 km/h | From 335e719b5dee259ba8b368f9fa9f3e29f0c0667d Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Wed, 8 Oct 2014 11:01:58 +0200 Subject: [PATCH 2/2] pick compressed edge-weights in correct order --- Contractor/EdgeBasedGraphFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Contractor/EdgeBasedGraphFactory.cpp b/Contractor/EdgeBasedGraphFactory.cpp index 69afdf32f..0edbc00fe 100644 --- a/Contractor/EdgeBasedGraphFactory.cpp +++ b/Contractor/EdgeBasedGraphFactory.cpp @@ -176,7 +176,7 @@ EdgeBasedGraphFactory::InsertEdgeBasedNode(const NodeID node_u, const NodeID nod current_edge_target_coordinate_id, forward_data.nameID, forward_geometry[i].second, - reverse_geometry[i].second, + reverse_geometry[geometry_size - 1 - i].second, forward_dist_prefix_sum[i], reverse_dist_prefix_sum[i], m_geometry_compressor.GetPositionForID(e1),