For next street returns "[ref] name" . For highway exits (or main roads with exit info) returns "[junction:ref]: [target:ref] > target". If no |target| - it will be replaced by |name| of next street. If no |target:ref| - it will be replaced by |ref| of next road. So if link has no info at all, "[ref] name" of next will be returned (as for next street).
| 347 | // If no |target:ref| - it will be replaced by |ref| of next road. |
| 348 | // So if link has no info at all, "[ref] name" of next will be returned (as for next street). |
| 349 | void GetFullRoadName(RouteSegment::RoadNameInfo & road, std::string & name) |
| 350 | { |
| 351 | if (auto const & sh = ftypes::GetRoadShields(road.m_ref); !sh.empty()) |
| 352 | road.m_ref = sh[0].m_name; |
| 353 | if (auto const & sh = ftypes::GetRoadShields(road.m_destination_ref); !sh.empty()) |
| 354 | road.m_destination_ref = sh[0].m_name; |
| 355 | |
| 356 | name.clear(); |
| 357 | if (road.HasExitInfo()) |
| 358 | { |
| 359 | if (!road.m_junction_ref.empty()) |
| 360 | name = "[" + road.m_junction_ref + "]"; |
| 361 | |
| 362 | if (!road.m_destination_ref.empty()) |
| 363 | name += std::string(name.empty() ? "" : ": ") + "[" + road.m_destination_ref + "]"; |
| 364 | |
| 365 | if (!road.m_destination.empty()) |
| 366 | name += std::string(name.empty() ? "" : " ") + "> " + road.m_destination; |
| 367 | else if (!road.m_name.empty()) |
| 368 | name += (road.m_destination_ref.empty() ? std::string(name.empty() ? "" : " ") : ": ") + road.m_name; |
| 369 | } |
| 370 | else |
| 371 | { |
| 372 | if (!road.m_ref.empty()) |
| 373 | name = "[" + road.m_ref + "]"; |
| 374 | if (!road.m_name.empty()) |
| 375 | name += (name.empty() ? "" : " ") + road.m_name; |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | double RoutingSession::GetDistanceToNextTurn() const |
| 380 | { |
no test coverage detected