Fixes issue #202

This commit is contained in:
DennisOSRM 2012-03-23 17:44:56 +01:00
parent 2549f7254a
commit e4080aba05

View File

@ -135,7 +135,7 @@ public:
if(segment.necessary) if(segment.necessary)
++prefixSumOfNecessarySegments; ++prefixSumOfNecessarySegments;
} }
if(durationOfTrip != INT_MAX) {
reply.content += ",[\""; reply.content += ",[\"";
reply.content += TurnInstructions.TurnStrings[TurnInstructions.ReachedYourDestination]; reply.content += TurnInstructions.TurnStrings[TurnInstructions.ReachedYourDestination];
reply.content += "\",\""; reply.content += "\",\"";
@ -152,6 +152,7 @@ public:
reply.content += "\","; reply.content += "\",";
reply.content += "0.0"; reply.content += "0.0";
reply.content += "]"; reply.content += "]";
}
} else { } else {
BOOST_FOREACH(const SegmentInformation & segment, descriptionFactory.pathDescription) { BOOST_FOREACH(const SegmentInformation & segment, descriptionFactory.pathDescription) {
short currentInstruction = segment.turnInstruction & TurnInstructions.InverseAccessRestrictionFlag; short currentInstruction = segment.turnInstruction & TurnInstructions.InverseAccessRestrictionFlag;
@ -159,7 +160,7 @@ public:
} }
} }
reply.content += "],"; reply.content += "],";
// INFO("Entered " << numberOfEnteredRestrictedAreas << " restricted areas"); // INFO("Entered " << numberOfEnteredRestrictedAreas << " restricted areas");
descriptionFactory.BuildRouteSummary(descriptionFactory.entireLength, durationOfTrip - ( numberOfEnteredRestrictedAreas*TurnInstructions.AccessRestrictionPenaly)); descriptionFactory.BuildRouteSummary(descriptionFactory.entireLength, durationOfTrip - ( numberOfEnteredRestrictedAreas*TurnInstructions.AccessRestrictionPenaly));
reply.content += "\"route_summary\": {" reply.content += "\"route_summary\": {"