diff options
author | Vladimir Byko-Ianko <v.bykoianko@corp.mail.ru> | 2015-02-20 16:11:52 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:37:35 +0300 |
commit | e64f6e6de4d0632ce9a69f0d0ea01f5adfa5e66e (patch) | |
tree | 979283ea392a2cc33a981ecd3ff2695077bf899c /routing | |
parent | db0f5fcfdfed42429d29fb9cb001e5cfce1274c4 (diff) |
Checking if fid is equal to INVALID_FID.
Diffstat (limited to 'routing')
-rw-r--r-- | routing/osrm_router.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/routing/osrm_router.cpp b/routing/osrm_router.cpp index 18bc1b581a..b5c33a22a2 100644 --- a/routing/osrm_router.cpp +++ b/routing/osrm_router.cpp @@ -189,6 +189,9 @@ public: for (int i = si; i != ei; i += di) { m_mapping.GetSegmentByIndex(i, s); + if (!s.IsValid()) + continue; + auto s1 = min(s.m_pointStart, s.m_pointEnd); auto e1 = max(s.m_pointEnd, s.m_pointStart); @@ -638,7 +641,7 @@ m2::PointD OsrmRouter::GetPointByNodeId(const size_t node_id, RoutingMappingPtrT else routingMapping->m_segMapping.GetSegmentByIndex(nSegs.second - 1, seg); - if (seg.m_fid == OsrmFtSegMapping::FtSeg::INVALID_FID) + if (!seg.IsValid()) return m2::PointD::Zero(); FeatureType ft; @@ -1366,6 +1369,8 @@ void OsrmRouter::GetPossibleTurns(NodeID node, auto const range = routingMapping->m_segMapping.GetSegmentsRange(trg); OsrmFtSegMapping::FtSeg seg; routingMapping->m_segMapping.GetSegmentByIndex(range.first, seg); + if (!seg.IsValid()) + continue; FeatureType ft; Index::FeaturesLoaderGuard loader(*m_pIndex, routingMapping->GetMwmId()); |