Make DouglasPeucker a free standing function

This commit is contained in:
Daniel J. Hofmann
2016-01-08 12:55:37 +01:00
committed by Patrick Niklaus
parent 23cd4d5ed2
commit c590596dbe
5 changed files with 73 additions and 70 deletions
+3 -4
View File
@@ -272,14 +272,13 @@ void SegmentList<DataFacadeT>::Finalize(const bool extract_alternative,
if (allow_simplification)
{
DouglasPeucker polyline_generalizer;
polyline_generalizer.Run(segments.begin(), segments.end(), zoom_level);
douglasPeucker(segments, zoom_level);
}
std::uint32_t necessary_segments = 0; // a running index that counts the necessary pieces
via_indices.push_back(0);
const auto markNecessarySegments = [this, &necessary_segments](SegmentInformation &first,
const SegmentInformation &second)
const auto markNecessarySegments =
[this, &necessary_segments](SegmentInformation &first, const SegmentInformation &second)
{
if (!first.necessary)
return;