| 378 | } |
| 379 | |
| 380 | double Route::GetPolySegAngle(size_t ind) const |
| 381 | { |
| 382 | size_t const polySz = m_poly.GetPolyline().GetSize(); |
| 383 | |
| 384 | if (ind + 1 >= polySz) |
| 385 | { |
| 386 | ASSERT(false, ()); |
| 387 | return 0; |
| 388 | } |
| 389 | |
| 390 | m2::PointD const p1 = m_poly.GetPolyline().GetPoint(ind); |
| 391 | m2::PointD p2; |
| 392 | size_t i = ind + 1; |
| 393 | do |
| 394 | { |
| 395 | p2 = m_poly.GetPolyline().GetPoint(i); |
| 396 | } |
| 397 | while (AlmostEqualULPs(p1, p2) && ++i < polySz); |
| 398 | return (i == polySz) ? 0 : math::RadToDeg(ang::AngleTo(p1, p2)); |
| 399 | } |
| 400 | |
| 401 | bool Route::MatchLocationToRoute(location::GpsInfo & location, location::RouteMatchingInfo & routeMatchingInfo) const |
| 402 | { |