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
| Parameter | Type | Required | Description |
|---|---|---|---|
geo | T | Yes | Geometry 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 BOOLEAN | f2 BOOLEAN |
|---|---|
| true | false |
On this page