ST_RemoveRepeatedPoints

更新时间:
复制 MD 格式

Removes duplicate consecutive points from a geometry object and returns the cleaned geometry.

Syntax

geometry ST_RemoveRepeatedPoints(geometry geom, float8 tolerance);

Parameters

ParameterDescription
geomThe geometry object that you want to specify.
toleranceThe tolerance that you want to specify.

Examples

Remove exactly coincident points from a polygon:

SELECT ST_AsText(ST_RemoveRepeatedPoints('POLYGON((0 0,1 0,1 0,1 1,0 0))'::geometry));

Output:

         st_astext
----------------------------
 POLYGON((0 0,1 0,1 1,0 0))
(1 row)

The duplicate vertex (1 0) is removed.