Removes repeated points from a geometry object and returns a new geometry object.
Syntax
geometry ST_RemoveRepeatedPoints(geometry geom, float8 tolerance);Parameters
Parameter | Description |
geom | The geometry object from which to remove repeated points. |
tolerance | The tolerance value for point comparison. |
Example
The following example removes repeated points from a polygon using default parameter settings. The input polygon contains duplicate vertex 1 0, which appears twice. After the function runs, the output polygon has the duplicate removed.
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)该文章对您有帮助吗?