This commit is contained in:
Moritz Kobitzsch 2017-07-31 14:49:35 +02:00 committed by Daniel Patterson
parent 28ddd983b3
commit 8319a96aed
No known key found for this signature in database
GPG Key ID: 19C12BE1725A028B
3 changed files with 30 additions and 10 deletions

View File

@ -167,7 +167,8 @@ class RouteAPI : public BaseAPI
* the overall response consistent.
*
* CAUTION: order of post-processing steps is important
* - handleRoundabouts must be called before collapseTurnInstructions that expects
* - handleRoundabouts must be called before collapseTurnInstructions that
*expects
* post-processed roundabouts without Exit instructions
*/

View File

@ -43,14 +43,33 @@ const constexpr char *modifier_names[] = {"uturn",
// translations of TurnTypes. Not all types are exposed to the outside world.
// invalid types should never be returned as part of the API
const constexpr char *turn_type_names[] = {
"invalid", "new name", "continue", "turn",
"merge", "on ramp", "off ramp", "fork",
"end of road", "notification", "roundabout", "roundabout and exit",
"rotary", "rotary and exit", "roundabout turn", "roundabout turn and exit",
"use lane", "invalid", "invalid", "roundabout", "exit roundabout",
"rotary", "exit rotary", "roundabout turn", "exit roundabout turn",
"invalid", "invalid"};
const constexpr char *turn_type_names[] = {"invalid",
"new name",
"continue",
"turn",
"merge",
"on ramp",
"off ramp",
"fork",
"end of road",
"notification",
"roundabout",
"roundabout and exit",
"rotary",
"rotary and exit",
"roundabout turn",
"roundabout turn and exit",
"use lane",
"invalid",
"invalid",
"roundabout",
"exit roundabout",
"rotary",
"exit rotary",
"roundabout turn",
"exit roundabout turn",
"invalid",
"invalid"};
const constexpr char *waypoint_type_names[] = {"invalid", "arrive", "depart"};

View File

@ -96,7 +96,7 @@ void processRoundaboutExits(const RouteStepIterator begin, const RouteStepIterat
const auto exit = std::count_if(begin, end, passes_exit_or_leaves_roundabout);
// removes all intermediate instructions, assigns names and exit numbers
BOOST_ASSERT(leavesRoundabout((end-1)->maneuver.instruction));
BOOST_ASSERT(leavesRoundabout((end - 1)->maneuver.instruction));
BOOST_ASSERT(std::distance(begin, end) >= 1);
(end - 1)->maneuver.exit = exit;