| 92 | } |
| 93 | |
| 94 | bool ScoreCandidatePointsGetter::IsJunction(m2::PointD const & p) |
| 95 | { |
| 96 | Graph::EdgeListT outgoing; |
| 97 | m_graph.GetRegularOutgoingEdges(geometry::PointWithAltitude(p, 0 /* altitude */), outgoing); |
| 98 | |
| 99 | Graph::EdgeListT ingoing; |
| 100 | m_graph.GetRegularIngoingEdges(geometry::PointWithAltitude(p, 0 /* altitude */), ingoing); |
| 101 | |
| 102 | // Note. At mwm borders the size of |ids| may be bigger than two in case of straight |
| 103 | // road because of road feature duplication at borders. |
| 104 | std::set<std::pair<uint32_t, uint32_t>> ids; |
| 105 | for (auto const & e : outgoing) |
| 106 | ids.insert(std::make_pair(e.GetFeatureId().m_index, e.GetSegId())); |
| 107 | |
| 108 | for (auto const & e : ingoing) |
| 109 | ids.insert(std::make_pair(e.GetFeatureId().m_index, e.GetSegId())); |
| 110 | |
| 111 | // Size of |ids| is number of different pairs of (feature id, segment id) starting from |
| 112 | // |p| plus going to |p|. The size 0, 1 or 2 is considered |p| is not a junction of roads. |
| 113 | // If the size is 3 or more it means |p| is an intersection of 3 or more roads. |
| 114 | return ids.size() >= 3; |
| 115 | } |
| 116 | |
| 117 | Score ScoreCandidatePointsGetter::GetScoreByDistance(m2::PointD const & point, m2::PointD const & candidate) |
| 118 | { |
nothing calls this directly
no test coverage detected