Name

ST_RepeatedPoints — Checks if a geometry has repeated vertices. If any, returns a MultiPoint geometry composed by the points that are duplicated.

Synopsis

geometry ST_RepeatedPoints(bytea Geometry);

Alias

RepeatedPoints

Description

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.

[Note]

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.

Coordinate Dimensions
2D3DM
--
Spatial Standards Support
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
----

Examples

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 

Related functions