Upper bound for ordinals. Unlikely that any roundabout has more than 10

exits, but again, OSM has unlimited opportunities.
This commit is contained in:
DennisOSRM 2012-03-08 11:37:41 +01:00
parent 3ea1461839
commit 88890a1914
2 changed files with 4 additions and 3 deletions

View File

@ -43,7 +43,7 @@ struct TurnInstructionsClass {
const static short StartAtEndOfStreet = 14;
std::string TurnStrings[15];
std::string Ordinals[11];
std::string Ordinals[12];
//This is a hack until c++0x is available enough to use initializer lists.
TurnInstructionsClass(){
@ -73,7 +73,8 @@ struct TurnInstructionsClass {
Ordinals[7] = "seventh";
Ordinals[8] = "eighth";
Ordinals[9] = "nineth";
Ordinals[10] = "tenth";
Ordinals[10] = "tenth";
Ordinals[11] = "one of the too many";
};
static inline double GetTurnDirectionOfInstruction( const double angle ) {

View File

@ -114,7 +114,7 @@ public:
if(TurnInstructions.LeaveRoundAbout == segment.turnInstruction) {
reply.content += TurnInstructions.TurnStrings[TurnInstructions.EnterRoundAbout];
reply.content += " and leave at ";
reply.content += TurnInstructions.Ordinals[roundAbout.leaveAtExit+1];
reply.content += TurnInstructions.Ordinals[std::min(11,roundAbout.leaveAtExit+1)];
reply.content += " exit";
roundAbout.leaveAtExit = 0;
} else {