Name

ST_IsClosed — Tests if a LineString is closed.

Synopsis

boolean ST_IsClosed(bytea LineString);

Alias

IsClosed

Description

Tests if a LineString is closed. Returns TRUE if the LineString is closed (StartPoint and EndPoint are the same Point). Returns Null if the incoming geometry is not a LineString or a MultiLineString.

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
2.1.5.17.2.12.17.2.17.27.1.5 , 9.3.3

Examples

SELECT ST_IsClosed(ST_GeomFromText('LINESTRING (0 0, 10 20, 30 20)'));
--Result
FALSE

SELECT ST_IsClosed(ST_GeomFromText('LINESTRING (0 0, 10 20, 30 20,0 0)'));
--Result
TRUE

SELECT ST_IsClosed(ST_GeomFromText('MULTILINESTRING ((0 0, 10 20, 30 20, 0 0), (100 100, 110 120, 130 120, 108 100))'));
--Result
FALSE

SELECT ST_IsClosed(ST_GeomFromText('POINT(0 0)'));
--Result
null

Related functions

ST_IsRing