ST_ISCLOSED()

All functions > GEOSPATIAL > ST_ISCLOSED()

Returns TRUE if a geometry is closed (start point equals end point for lines; always TRUE for polygons and points).

Signatures

Is closed

Returns: TRUE if closed

ST_ISCLOSED(geo: T) → BOOLEAN
sql
ParameterTypeRequiredDescription
geoTYesGeometry value

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY

Signature notes:

  • LineString: TRUE if the first and last vertices are equal
  • MultiLineString: TRUE if all component lines are closed
  • Point and Polygon: always TRUE
  • GEOMETRY only; not supported on BigQuery
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ST_ISCLOSED(ST_GEOMFROMTEXT('LINESTRING (0 0, 1 1, 0 0)')), -- Closed line (start equals end)
    f2 := ST_ISCLOSED(ST_GEOMFROMTEXT('LINESTRING (0 0, 1 1, 2 0)')) -- Open line
;
Result
f1 BOOLEANf2 BOOLEAN
truefalse

Last update at: 2026/05/26 17:22:09