Returns true if a geometry object is closed.
Syntax
boolean ST_IsClosed(geometry g);Parameters
| Parameter | Description |
|---|---|
g | The 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)该文章对您有帮助吗?