CARIS HIPS and SIPS : Feature Editing : Filter Methods : Douglas-Peucker Algorithm
 

Douglas-Peucker Algorithm

The Douglas-Peucker algorithm creates a simplified curve and then measures the maximum distance between it and the original curve. The simplified curve is modified based on this measurement, then the process is repeated.

A tolerance value determines the amount of processing done on the line. The larger the tolerance, the fewer resulting points.

The first simplified curve is a straight line (AB) drawn between the two end points. This indicates the trend of the original line.

The maximum deviation (FG) from the original line to the trend line is calculated.

The maximum deviation is greater than the tolerance, so two new trend lines (AG and GB) are drawn.

The maximum deviations (HI and JK) from the new trend lines are calculated and compared to the tolerance.

The maximum deviation (HI) from trend line AG is less than the tolerance, so trend line AG replaces the original line segment.

The maximum deviation (JK) from trend line GB is longer than the tolerance, so two more trend lines are drawn (GJ and JB) and maximum deviations (CD and MN) are calculated.

Both GJ and JB are shorter than the tolerance, so the trend lines replace the original line segments.

This image shows the result of the filter.

If a tolerance of 0 is used, only nodes along a straight line are removed. This means that if you have a straight line with three nodes (start, end, and middle), the middle node is removed since it does not change the shape of the line.