geo.regionApproximate(
$region as cts.region,
$threshold as Number,
[$options as String[]]
) as cts.region

Summary

This function returns a simplified approximation of the region,
using the Douglas-Peucker algorithm. The threshold specifies how close an
approximation this should be in the same units as tolerance.
The tolerance option should be smaller than the threshold.

Parameters

$region

A cts region.

$threshold

The threshold.

$options

Options include:

"coordinate-system=name"

Use the named coordinate system. Valid names are wgs84
for the WGS84 coordinate system and raw for the
unmapped planar coordinate system

"tolerance"

A tolerance value. For the raw coordinate system, use the units
of the coordinate system. For other (geodetic) coordinate systems,
use the units specified by the units option. If the tolerance is
too fine for the precision, inconsistencies may result and a larger
tolerance should be used.

"units=miles"

Distance is measured in miles.

Example

geo.regionApproximate(
cts.polygon([
cts.point(0,0),
cts.point(4,0),
cts.point(2,10),
cts.point(2,14),
cts.point(2,11),
cts.point(0,4),
cts.point(0,0)]), 400, ['tolerance=1'])
// => A cts.region with the coordinates 0,0 2,14 2,11 0,0

## Comments