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.;
|
result -= 360.;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleLogger().Write(logDEBUG) << "bearing between " << A << " and " << B << " is " << result;
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,26 +103,18 @@ void DescriptionFactory::SetEndSegment(const PhantomNode & target, const bool ta
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DescriptionFactory::AppendSegment(
|
void DescriptionFactory::AppendSegment(const FixedPointCoordinate & coordinate, const PathData & path_point)
|
||||||
const FixedPointCoordinate & coordinate,
|
{
|
||||||
const PathData & data
|
if ((1 == pathDescription.size()) && ( pathDescription.back().location == coordinate))
|
||||||
) {
|
{
|
||||||
// if(
|
pathDescription.back().name_id = path_point.name_id;
|
||||||
// ( 1 == pathDescription.size()) &&
|
}
|
||||||
// ( pathDescription.back().location == coordinate)
|
else
|
||||||
// ) {
|
{
|
||||||
// pathDescription.back().name_id = data.name_id;
|
pathDescription.push_back(
|
||||||
// } else {
|
SegmentInformation(coordinate, path_point.name_id, path_point.durationOfSegment, 0, path_point.turnInstruction)
|
||||||
pathDescription.push_back(
|
);
|
||||||
SegmentInformation(
|
}
|
||||||
coordinate,
|
|
||||||
data.name_id,
|
|
||||||
data.durationOfSegment,
|
|
||||||
0,
|
|
||||||
data.turnInstruction
|
|
||||||
)
|
|
||||||
);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DescriptionFactory::AppendEncodedPolylineString(
|
void DescriptionFactory::AppendEncodedPolylineString(
|
||||||
|
@ -187,8 +187,6 @@ public:
|
|||||||
pathDescription.back().turn_instruction = TurnInstructionsClass::NoTurn;
|
pathDescription.back().turn_instruction = TurnInstructionsClass::NoTurn;
|
||||||
target_phantom.name_id = (pathDescription.end()-2)->name_id;
|
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(std::numeric_limits<double>::epsilon() > pathDescription[0].length) {
|
||||||
if(pathDescription.size() > 2) {
|
if(pathDescription.size() > 2) {
|
||||||
@ -197,8 +195,6 @@ public:
|
|||||||
pathDescription[0].necessary = true;
|
pathDescription[0].necessary = true;
|
||||||
start_phantom.name_id = pathDescription[0].name_id;
|
start_phantom.name_id = pathDescription[0].name_id;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// pathDescription[0].duration *= start_phantom.ratio;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Generalize poly line
|
//Generalize poly line
|
||||||
|
Loading…
Reference in New Issue
Block a user