| 42 | } |
| 43 | |
| 44 | util::json::Array lanesFromIntersection(const guidance::IntermediateIntersection &intersection) |
| 45 | { |
| 46 | BOOST_ASSERT(intersection.lanes.lanes_in_turn >= 1); |
| 47 | util::json::Array result; |
| 48 | result.values.reserve(intersection.lane_description.size()); |
| 49 | LaneID lane_id = intersection.lane_description.size(); |
| 50 | |
| 51 | for (const auto &lane_desc : intersection.lane_description) |
| 52 | { |
| 53 | --lane_id; |
| 54 | util::json::Object lane; |
| 55 | lane.values.emplace("indications", toJSON(lane_desc)); |
| 56 | if (lane_id >= intersection.lanes.first_lane_from_the_right && |
| 57 | lane_id < |
| 58 | intersection.lanes.first_lane_from_the_right + intersection.lanes.lanes_in_turn) |
| 59 | lane.values.emplace("valid", util::json::True()); |
| 60 | else |
| 61 | lane.values.emplace("valid", util::json::False()); |
| 62 | |
| 63 | result.values.emplace_back(std::move(lane)); |
| 64 | } |
| 65 | |
| 66 | return result; |
| 67 | } |
| 68 | |
| 69 | const constexpr char *waypoint_type_names[] = {"invalid", "arrive", "depart"}; |
| 70 |
no test coverage detected