remove first segment if distance is 0 (down to 7 failed)
This commit is contained in:
parent
0b89a9d554
commit
9ccc8a7404
@ -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(
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user