ST_IsClosed

更新时间:
复制 MD 格式

Returns true if a geometry object is closed.

Syntax

boolean ST_IsClosed(geometry g);

Parameters

ParameterDescription
gThe geometry object to check.

Description

  • For polyhedral surfaces, indicates whether the object is a closed geometry or an open plane.

  • Preserves Z coordinates; 3D objects are fully supported.

  • Supports polyhedral surfaces, circular strings, and curves.

Examples

Non-closed LineString:

SELECT ST_IsClosed('LINESTRING(0 0,0 1)'::geometry);
 st_isclosed
-------------
 f
(1 row)

Closed LineString (start and end points are identical):

SELECT ST_IsClosed('LINESTRING(0 0,0 1,1 0,0 0)'::geometry);
 st_isclosed
-------------
 t
(1 row)