This topic describes the ST_IsClosed function. This function returns true if the input geometry object is closed.

Syntax

boolean  ST_IsClosed(geometry  g);

Parameters

Parameter Description
g The geometry object that you want to specify.

Description

  • If you specify a polyhedral surfaces, the result of this function indicates whether the object is an open plane or a closed geometry.
  • This function supports 3D objects and does not delete z coordinates.
  • This function supports polyhedral surfaces.
  • This function supports circular strings and curves.

Examples

  • Results returned by specifying a nonclosed geometry object:
    SELECT ST_IsClosed('LINESTRING(0 0,0 1)'::geometry);
     st_isclosed
    -------------
     f
    (1 row)
                        
  • Results returned by specifying a closed geometry object:
    SELECT ST_IsClosed('LINESTRING(0 0,0 1,1 0,0 0)'::geometry);
     st_isclosed
    -------------
     t
    (1 row)