ST_IsRing()

TL;DR

Use ST_IsRing() to test whether a LINESTRING is both closed and simple.

Returns whether a LINESTRING is closed and simple.

Syntax

ST_IsRing(geom)

Arguments

Argument

Description

geom

A GEOMETRY or GEOMETRY32 LINESTRING value.

Return Value

Returns bool.

Usage Notes

Examples

DROP DATABASE IF EXISTS geo_accessor_demo;
CREATE DATABASE geo_accessor_demo;
USE geo_accessor_demo;
SELECT ST_IsRing(ST_GeomFromText('LINESTRING(0 0,2 0,1 1,0 0)')) AS is_ring;
DROP DATABASE geo_accessor_demo;

See Also

ST_IsClosed, ST_IsEmpty