ST_IsRing - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

ST_IsRing

ST_IsRing returns true if the input linestring is a ring. A linestring is a ring if it is closed and simple.

Syntax

ST_IsRing(geom)

Arguments

geom

A value of data type GEOMETRY or an expression that evaluates to a GEOMETRY type. The geometry must be a LINESTRING.

Return type

BOOLEAN

If geom is not a LINESTRING, then an error is returned.

Examples

The following SQL checks if the specified linestring is a ring.

SELECT ST_IsRing(ST_GeomFromText('linestring(0 0, 1 1, 1 2, 0 0)'));
st_isring ----------- true