Name

ST_GeometryType — Returns the name of the instantiable subtype of Geometry of which the input geometric object is a member, as a string

Synopsis

varchar ST_GeometryType(bytea Geometry);

Alias

-

Description

Returns the name of the instantiable subtype of Geometry of which the input geometric object is a member, as a string. E.g. "ST_POLYGON", "ST_LINESTRING", "ST_POINT".

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
2.1.1.17.2.10.17.2.8.25.1.4

Examples

SELECT ST_GeometryType(ST_GeomFromText('GEOMETRYCOLLECTION(POINT (5 5),LINESTRING (0 0, 0 50))')); 
--Result
ST_GeometryCollection

SELECT ST_GeometryType(ST_GeomFromText('POLYGON ((20 20, 50 50, 20 50, 20 20))'));
--Result
ST_Polygon

Related functions

GeometryType