From c06a8c21007cf8f2fee4309549beb9a86abad582 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Thu, 29 Oct 2015 14:16:02 +0300 Subject: [PATCH 1/2] OSRM candidates filter fix. --- routing/osrm_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routing/osrm_helpers.cpp b/routing/osrm_helpers.cpp index 1b35639d1a..147e14441e 100644 --- a/routing/osrm_helpers.cpp +++ b/routing/osrm_helpers.cpp @@ -44,7 +44,7 @@ void Point2PhantomNode::operator()(FeatureType const & ft) FindNearestSegment(ft, m_point, res); - if (res.m_fid != kInvalidFid) + if (res.m_fid != kInvalidFid && !m_routingMapping.m_segMapping.GetNodeIdByFid(res.m_fid).empty()) m_candidates.push_back(res); } From 821876b8647b2bc1e80d7e51630cebc5a1ea8561 Mon Sep 17 00:00:00 2001 From: Lev Dragunov Date: Thu, 29 Oct 2015 15:46:16 +0300 Subject: [PATCH 2/2] Routing integration test of a OSRM node filtering. --- .../routing_integration_tests/osrm_route_test.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/routing/routing_integration_tests/osrm_route_test.cpp b/routing/routing_integration_tests/osrm_route_test.cpp index f6690ef895..c44811134a 100644 --- a/routing/routing_integration_tests/osrm_route_test.cpp +++ b/routing/routing_integration_tests/osrm_route_test.cpp @@ -8,6 +8,19 @@ using namespace routing; namespace { + // Node filtering test. SVO has many restricted service roads that absent in a OSRM index. + UNIT_TEST(MoscowToSVOAirport) + { + integration::CalculateRouteAndTestRouteLength( + integration::GetOsrmComponents(), + MercatorBounds::FromLatLon(55.75100, 37.61790), {0., 0.}, + MercatorBounds::FromLatLon(55.97310, 37.41460), 30470.); + integration::CalculateRouteAndTestRouteLength( + integration::GetOsrmComponents(), + MercatorBounds::FromLatLon(55.97310, 37.41460), {0., 0.}, + MercatorBounds::FromLatLon(55.75100, 37.61790), 30470.); + } + // Restrictions tests. Check restrictions generation, if there are any errors. UNIT_TEST(RestrictionTestNeatBaumanAndTTK) {