ST_RepeatedPoints — Checks if a geometry has repeated vertices. If any, returns a MultiPoint geometry composed by the points that are duplicated.
geometry ST_RepeatedPoints(bytea
Geometry);
Checks if a geometry has repeated vertices. If any, returns a MultiPoint geometry composed by the points that are duplicated.. If there are not repeated points returns null.
Repeated vertices may be a symptom of an error in the capture of the geometries.
![]() | |
This function does not eliminate the Z or M coordinates, but it does not consider them. For instance a line as LINESTRING(0 0 5, 0 0 8, 10 10 10), is considered to have the second vertex repeated. |
| 2D | 3D | M |
|---|---|---|
![]() | - | - |
| OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006)) | SQL-MM Part 3 |
|---|---|---|---|
| - | - | - | - |
SELECT ST_AsEWKT(ST_RepeatedPoints(ST_GeomFromEWKT('LINESTRING (0 0 15, 10 10 25, 10 10 25, 20 10 35)')));
--Result:
st_asewkt
-------------------------
MULTIPOINT ((10 10 25))
(1 row)
SELECT ST_AsEWKT(ST_RepeatedPoints(ST_GeomFromEWKT('LINESTRING (0 0 15, 10 10 25, 10 10 25, 10 10 5, 20 10 35)')));
--Result:
st_asewkt
------------------------------------
MULTIPOINT ((10 10 25), (10 10 5))
(1 row)
SELECT St_ASEWKT(ST_RepeatedPoints(ST_GeomFromEWKT('MULTIPOINT (0 10, 0 20, 20 20, 20 10, 0 10)')));
--Result:
MULTIPOINT ((0 10))
SELECT ST_RepeatedPoints(ST_GeomFromEWKT('POLYGON ((0 10, 0 20, 20 20, 20 10, 0 10))'));
--Result:
null