ST_IsRing

Determine whether a line geometry is a ring, that is, whether it is closed and simple.

Syntax

ST_IsRing(geo);
geo
The input line geometry.

Type: ST_GEOMETRY(ANY)

Returns

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

Examples

SELECT inza..ST_IsRing(inza..ST_WKTToSQL('LINESTRING (0 0, 11 0, 11 11, 0 0))'));
 
ST_ISRING
---------
t
(1 row)
SELECT inza..ST_IsRing(inza..ST_WKTToSQL('LINESTRING (1 2, 3 4, 5 6))'));
 
ST_ISRING
---------
f
(1 row)