示例#1
0
util::json::Value ApiResponseGenerator<DataFacadeT>::GetGeometry(const bool return_encoded,
                                                                 const Segments &segments) const
{
    if (return_encoded)
        return polylineEncodeAsJSON(segments.Get());
    else
        return polylineUnencodedAsJSON(segments.Get());
}
示例#2
0
std::vector<detail::Segment>
ApiResponseGenerator<DataFacadeT>::BuildRouteSegments(const Segments &segment_list) const
{
    std::vector<detail::Segment> result;
    for (const auto &segment : segment_list.Get())
    {
        const auto current_turn = segment.turn_instruction;
        if (extractor::isTurnNecessary(current_turn) &&
            (extractor::TurnInstruction::EnterRoundAbout != current_turn))
        {

            detail::Segment seg = {segment.name_id,
                                   static_cast<int32_t>(segment.length),
                                   static_cast<std::size_t>(result.size())};
            result.emplace_back(std::move(seg));
        }
    }
    return result;
}