ST_GEOMETRYTYPE()
All functions > GEOSPATIAL > ST_GEOMETRYTYPE()
Returns the OGC type name of a geometry or geography as a string.
Signatures
Geometry type
Returns: OGC-style type label as a string (e.g. DuckDB: POINT, POLYGON; other engines may use ST_Point, ST_Polygon, …)
ST_GEOMETRYTYPE(geo: T) → VARCHAR sql
| Parameter | Type | Required | Description |
|---|---|---|---|
geo | T | Yes | Geometry or geography value |
With:
T: Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY
Signature notes:
- Return value format varies by engine (DuckDB spatial uses plain POINT, POLYGON, …; others may prefix with ST_)
- Returns NULL if the input is NULL
Availability
| Status | Backends |
|---|---|
| Not available | clickhouse, mysql |
Examples
FeatureQL
RETURN
-- Type of a point (DuckDB label)
f1 := ST_GEOMETRYTYPE(ST_GEOMPOINT(1.0, 2.0))
;Result
| f1 VARCHAR |
|---|
| POINT |
On this page