Douglas-Peucker

This map shows the Douglas-Peuker line simplification algorithm in action:

Input polyline (red) has 108 points, the output polyline (blue) has 38 points.

I have implemented the algorithm in PHP, the code is free to use.

Try changing the tolerance, to see how the simplified line changes:

Tolerance: (try 0.1, 0.01, 0.001, for example)