Function: pgeneralize

Syntax

pgeneralize (<points>,<num>)

Type

point

Returns

A generalized version of a supplied polyline.

Generalization performs vector smoothing according to a supplied generalization factor (distance). Points which are within distance of each other are removed, and those which are within distance from the centre-line are snapped to form a new center-line.

Parameters

Notes

The smoothing algorithm used by this function is the Douglas-Peucker Hull algorithm, see:
"D. H. Douglas and T. K. Peucker. Algorithms for the reduction of the number of points required to represent a line or its caricature."
The Canadian Cartographer, 10(2):112--122, 1973.

Examples

point ppp[]
# ... add commands to populate ppp
point newppp[] = pgeneralize(ppp,10)