reducem
Reduce density of points in vector data
Syntax
[latout,lonout] = reducem(latin,lonin)
[latout,lonout] = reducem(latin,lonin,tol)
[latout,lonout,cerr] = reducem(...)
[latout,lonout,cerr,tol] = reducem(...)
Description
[latout,lonout] = reducem(latin,lonin)
reduces
the number of points in vector map data. In this case the tolerance
is computed automatically.
[latout,lonout] = reducem(latin,lonin,tol)
uses
the provided tolerance. The units of the tolerance are degrees of
arc on the surface of a sphere.
[latout,lonout,cerr] = reducem(...)
in
addition returns a measure of the error introduced by the simplification.
The output cerr
is the difference in the arc length
of the original and reduced data, normalized by the original length.
[latout,lonout,cerr,tol] = reducem(...)
also
returns the tolerance used in the reduction, which is useful when
the tolerance is computed automatically.
Examples
Tips
Vector data is reduced using the Douglas-Peucker line simplification algorithm. This method recursively subdivides a polygon until a run of points can be replaced by a straight line segment, with no point in that run deviating from the straight line by more than the tolerance. The distances used to decide on which runs of points to eliminate are computed in a Plate Carrée projection.
Reduced geographic data might not always be appropriate for display. If all intermediate points in a data set are reduced, then lines appearing straight in one projection are incorrectly displayed as straight lines in others.
Version History
Introduced before R2006a