phayes/geoPHP — pull request #47 by Polzme (2012-07-30 21:25:17+00:00)
Title: Simplify LineString using Douglas-Peucker algorithm

The Douglas–Peucker algorithm is an algorithm for reducing the number of points in a curve that is approximated by a series of points.

I've implemented the algorithm, this could be the first step of a better implementation.

More information: http://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm

Example with geoPHP:
```
x201 tests # php test.php
GEOS is not installed.
---- Testing 20120702.gpx
numPoints before: 2861
Running $geometry->simplify(0.01);
numPoints after: 8
Testing Done!

x201 tests # php test.php
GEOS is not installed.
---- Testing 20120702.gpx
numPoints before: 2861
Running $geometry->simplify(0.001);
numPoints after: 18
Testing Done!

x201 tests # php test.php
GEOS is not installed.
---- Testing 20120702.gpx
numPoints before: 2861
Running $geometry->simplify(0.0001);
numPoints after: 66
Testing Done!

x201 tests # php test.php
GEOS is not installed.
---- Testing 20120702.gpx
numPoints before: 2861
Running $geometry->simplify(0.00001);
numPoints after: 392
Testing Done!
```