simplify<T extends Point<double>> function
List<T>
simplify<
T extends Point<double>>(- List<T> points,
- {double? tolerance,
- bool highestQuality = false}
)
Implementation
List<T> simplify<T extends Point<double>>(
List<T> points, {
double? tolerance,
bool highestQuality = false,
}) {
if (points.length <= 2) {
return points;
}
List<T> nextPoints = points;
final double sqTolerance = tolerance != null ? tolerance * tolerance : 1;
nextPoints =
highestQuality ? points : _simplifyRadialDist(nextPoints, sqTolerance);
nextPoints = _simplifyDouglasPeucker(nextPoints, sqTolerance);
return nextPoints;
}