MCPcopy Create free account
hub / github.com/comaps/comaps / KeepRoundaboutTurnByHighwayClass

Function KeepRoundaboutTurnByHighwayClass

libs/routing/car_directions.cpp:182–198  ·  view source on GitHub ↗

! * \brief Returns false when other possible turns leads to service roads; */

Source from the content-addressed store, hash-verified

180 * \brief Returns false when other possible turns leads to service roads;
181 */
182bool KeepRoundaboutTurnByHighwayClass(TurnCandidates const & possibleTurns, TurnInfo const & turnInfo,
183 NumMwmIds const & numMwmIds)
184{
185 Segment firstOutgoingSegment;
186 turnInfo.m_outgoing->m_segmentRange.GetFirstSegment(numMwmIds, firstOutgoingSegment);
187
188 for (auto const & t : possibleTurns.candidates)
189 {
190 if (t.m_segment == firstOutgoingSegment)
191 continue;
192 // For roundabouts of Tertiary and less significant class count every road.
193 // For more significant roundabouts - ignore service roads (driveway, parking_aisle).
194 if (turnInfo.m_outgoing->m_highwayClass >= HighwayClass::Tertiary || t.m_highwayClass != HighwayClass::ServiceMinor)
195 return true;
196 }
197 return false;
198}
199
200CarDirection GetRoundaboutDirection(TurnInfo const & turnInfo, TurnCandidates const & nodes,
201 NumMwmIds const & numMwmIds)

Callers 1

GetRoundaboutDirectionFunction · 0.85

Calls 1

GetFirstSegmentMethod · 0.80

Tested by

no test coverage detected