Removes duplicate consecutive points from a geometry object and returns the cleaned geometry.
Syntax
geometry ST_RemoveRepeatedPoints(geometry geom, float8 tolerance);Parameters
| Parameter | Description |
|---|---|
geom | The geometry object that you want to specify. |
tolerance | The 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.
该文章对您有帮助吗?