This topic describes the ST_SetEffectiveArea function. This function sets the effective area for each vertex of the input geometry object. This function uses the Visvalingam-Whyatt algorithm. The effective area of each vertex is stored as the M value.

Syntax

geometry  ST_SetEffectiveArea(geometry  geomA , float  threshold , integer  setArea);

Parameters

Parameter Description
geomA The geometry object that you want to specify.
threshold The tolerance that you want to specify. Default value: 0. If you specify this parameter, this function returns only the vertex whose effective area is greater than or equal to the value of this parameter.
setArea Default value: 1.

Description

  • If you specify the threshold parameter, this function can be used for server-side simplification.
  • If you do not specify the threshold parameter, this function can be used to simplify geometry objects.
  • This function supports simplification operations only on MultiLine objects, MultiPolygon objects, and MultiPoint objects. However, you can use this function to process any geometry objects.
  • The simplification operation is performed on the input geometry objects one by one. Therefore, you can use this function to process GeometryCollection objects.
  • The returned geometry object may lose its topology or be invalid.
  • The returned geometry object may lose its previous information stored in the M value.
  • The returned geometry object may lose its simplicity.
  • This function supports 3D objects, and the 3D dimension of the input geometry object affects the returned geometry object.

Examples

Results returned by using the default parameter settings:
SELECT ST_AsText(ST_SetEffectiveArea('LINESTRING(0 0,1 1,2 2 )'::geometry));
                      st_astext
------------------------------------------------------
 LINESTRING M (0 0 3.40282e+38,1 1 0,2 2 3.40282e+38)
(1 row)