# ST_Generalize function

The ST_Generalize function takes a geometry and a threshold as input parameters and represents the given geometry with a reduced number of points, while preserving the general characteristics of the geometry.

The Douglas-Peucker line-simplification algorithm is used, by which the sequence of points that define the geometry is recursively subdivided until a run of the points can be replaced by a straight line segment. In this line segment, none of the defining points deviates from the straight line segment by more than the given threshold. Z and M coordinates are not considered for the simplification. The resulting geometry is in the spatial reference system of the given geometry.

If the given geometry is empty, an empty geometry of type ST_Point is returned. If the given geometry or the threshold is null, null is returned.

This function can also be called as a method.

## Syntax

## Parameter

- geometry
- A value of type ST_Geometry or one of its subtypes that represents the geometry for which the line-simplification is applied.
- threshold
- A value of type DOUBLE that identifies the threshold to be used for the line-simplification algorithm. The threshold must be greater than or equal to 0 (zero). The larger the threshold, the smaller the number of points that will be used to represent the generalized geometry.

## Return type

db2gse.ST_Geometry

## Examples

In the following examples, the results have been reformatted for readability. The spacing in your results will vary according to your display.