ST_IsClosed

Determine if the line geometry is closed, that is, if the start and end points are equal.

Syntax

ST_IsClosed(geo);
geo
The input geometry.

Type: ST_GEOMETRY(ANY)

Returns

A value of type BOOL that is TRUE if the line is closed; otherwise FALSE.

Examples

SELECT inza..ST_IsClosed(inza..ST_WKTToSQL('LINESTRING (0 0, 11 0, 11 11, 0 0))'));
 
ST_ISCLOSED
-----------
t
(1 row)
SELECT inza..ST_IsClosed(inza..ST_WKTToSQL('LINESTRING ZM(1234,8888,9999,1234))'));

ST_ISCLOSED
-----------
t
(1 row)
SELECT inza..ST_IsClosed(inza..ST_WKTToSQL('LINESTRING (0 0, 11 0, 11 11))'));
 
ST_ISCLOSED
-----------
f
(1 row)