remove first segment if distance is 0 (down to 7 failed)

This commit is contained in:
Dennis Luxen 2014-04-01 16:13:54 +02:00
parent 0b89a9d554
commit 9ccc8a7404
2 changed files with 15 additions and 24 deletions

View File

@ -60,6 +60,9 @@ double DescriptionFactory::GetBearing(const FixedPointCoordinate & A, const Fixe
{
result -= 360.;
}
SimpleLogger().Write(logDEBUG) << "bearing between " << A << " and " << B << " is " << result;
return result;
}
@ -100,26 +103,18 @@ void DescriptionFactory::SetEndSegment(const PhantomNode & target, const bool ta
);
}
void DescriptionFactory::AppendSegment(
const FixedPointCoordinate & coordinate,
const PathData & data
) {
// if(
// ( 1 == pathDescription.size()) &&
// ( pathDescription.back().location == coordinate)
// ) {
// pathDescription.back().name_id = data.name_id;
// } else {
void DescriptionFactory::AppendSegment(const FixedPointCoordinate & coordinate, const PathData & path_point)
{
if ((1 == pathDescription.size()) && ( pathDescription.back().location == coordinate))
{
pathDescription.back().name_id = path_point.name_id;
}
else
{
pathDescription.push_back(
SegmentInformation(
coordinate,
data.name_id,
data.durationOfSegment,
0,
data.turnInstruction
)
SegmentInformation(coordinate, path_point.name_id, path_point.durationOfSegment, 0, path_point.turnInstruction)
);
// }
}
}
void DescriptionFactory::AppendEncodedPolylineString(

View File

@ -187,8 +187,6 @@ public:
pathDescription.back().turn_instruction = TurnInstructionsClass::NoTurn;
target_phantom.name_id = (pathDescription.end()-2)->name_id;
}
} else {
// pathDescription[segment_start_index].duration *= (1.-target_phantom.ratio);
}
if(std::numeric_limits<double>::epsilon() > pathDescription[0].length) {
if(pathDescription.size() > 2) {
@ -197,8 +195,6 @@ public:
pathDescription[0].necessary = true;
start_phantom.name_id = pathDescription[0].name_id;
}
} else {
// pathDescription[0].duration *= start_phantom.ratio;
}
//Generalize poly line