Implement smoothing and poly line approximation.