| 585 | }; |
| 586 | |
| 587 | flatbuffers::Offset<fbresult::Step> MakeFBStep(flatbuffers::FlatBufferBuilder &builder, |
| 588 | const guidance::LegGeometry &leg_geometry, |
| 589 | const guidance::RouteStep &step) const |
| 590 | { |
| 591 | auto name_string = builder.CreateString(step.name); |
| 592 | |
| 593 | flatbuffers::Offset<flatbuffers::String> ref_string; |
| 594 | if (!step.ref.empty()) |
| 595 | { |
| 596 | ref_string = builder.CreateString(step.ref); |
| 597 | } |
| 598 | |
| 599 | flatbuffers::Offset<flatbuffers::String> pronunciation_string; |
| 600 | if (!step.pronunciation.empty()) |
| 601 | { |
| 602 | pronunciation_string = builder.CreateString(step.pronunciation); |
| 603 | } |
| 604 | |
| 605 | flatbuffers::Offset<flatbuffers::String> destinations_string; |
| 606 | if (!step.destinations.empty()) |
| 607 | { |
| 608 | destinations_string = builder.CreateString(step.destinations); |
| 609 | } |
| 610 | |
| 611 | flatbuffers::Offset<flatbuffers::String> exists_string; |
| 612 | if (!step.exits.empty()) |
| 613 | { |
| 614 | exists_string = builder.CreateString(step.exits); |
| 615 | } |
| 616 | |
| 617 | flatbuffers::Offset<flatbuffers::String> rotary_name_string; |
| 618 | flatbuffers::Offset<flatbuffers::String> rotary_pronunciation_string; |
| 619 | if (!step.rotary_name.empty()) |
| 620 | { |
| 621 | rotary_name_string = builder.CreateString(step.rotary_name); |
| 622 | if (!step.rotary_pronunciation.empty()) |
| 623 | { |
| 624 | rotary_pronunciation_string = builder.CreateString(step.rotary_pronunciation); |
| 625 | } |
| 626 | } |
| 627 | auto mode_string = builder.CreateString(extractor::travelModeToString(step.mode)); |
| 628 | |
| 629 | // Geometry |
| 630 | auto geometry = MakeGeometry(builder, |
| 631 | leg_geometry.locations.begin() + step.geometry_begin, |
| 632 | leg_geometry.locations.begin() + step.geometry_end); |
| 633 | // Maneuver |
| 634 | fbresult::StepManeuverBuilder maneuver(builder); |
| 635 | fbresult::Position maneuverPosition{ |
| 636 | static_cast<float>(util::toFloating(step.maneuver.location.lon).__value), |
| 637 | static_cast<float>(util::toFloating(step.maneuver.location.lat).__value)}; |
| 638 | maneuver.add_location(&maneuverPosition); |
| 639 | maneuver.add_bearing_before(step.maneuver.bearing_before); |
| 640 | maneuver.add_bearing_after(step.maneuver.bearing_after); |
| 641 | if (step.maneuver.waypoint_type == guidance::WaypointType::None) |
| 642 | maneuver.add_type(TurnTypeToFB(step.maneuver.instruction.type)); |
| 643 | else |
| 644 | maneuver.add_type(WaypointTypeToFB(step.maneuver.waypoint_type)); |
no test coverage detected