Problems were partially caused by the limits of floating point accuracy.
This commit is contained in:
@@ -98,7 +98,8 @@ void DescriptionFactory::Run(const unsigned zoomLevel, const unsigned duration)
|
||||
|
||||
//Post-processing to remove empty or nearly empty path segments
|
||||
if(0. == startPhantom.ratio || 0 == pathDescription[0].length) {
|
||||
pathDescription.erase(pathDescription.begin());
|
||||
if(pathDescription.size() > 2)
|
||||
pathDescription.erase(pathDescription.begin());
|
||||
pathDescription[0].turnInstruction = TurnInstructions.HeadOn;
|
||||
pathDescription[0].necessary = true;
|
||||
startPhantom.nodeBasedEdgeNameID = pathDescription[0].nameID;
|
||||
@@ -106,7 +107,8 @@ void DescriptionFactory::Run(const unsigned zoomLevel, const unsigned duration)
|
||||
pathDescription[0].duration *= startPhantom.ratio;
|
||||
}
|
||||
if(1. == targetPhantom.ratio || 0 == pathDescription.back().length) {
|
||||
pathDescription.pop_back();
|
||||
if(pathDescription.size() > 2)
|
||||
pathDescription.pop_back();
|
||||
pathDescription.back().necessary = true;
|
||||
pathDescription.back().turnInstruction = TurnInstructions.NoTurn;
|
||||
targetPhantom.nodeBasedEdgeNameID = (pathDescription.end()-2)->nameID;
|
||||
|
||||
Reference in New Issue
Block a user