Returns true if a geometry is closed.
Syntax
boolean ST_IsClosed(geometry g)Parameters
| Parameter | Description |
|---|---|
g | The geometry to check. |
Usage notes
For polyhedral surfaces, indicates whether the surface is a closed geometry or an open plane.
Supports 3D geometries and preserves z coordinates.
Supports polyhedral surfaces.
Supports circular strings and curves.
Examples
Check whether a LineString is closed.
Open LineString — start and end points differ, so the function returns false:
SELECT ST_IsClosed('LINESTRING(0 0,0 1)'::geometry);
st_isclosed
-------------
f
(1 row)Closed LineString — start and end points are the same, so the function returns true:
SELECT ST_IsClosed('LINESTRING(0 0,0 1,1 0,0 0)'::geometry);
st_isclosed
-------------
t
(1 row)该文章对您有帮助吗?