Name

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

Synopsis

varchar GeometryType(bytea Geometry);

Alias

-

Description

Returns the name of the instantiable subtype of Geometry of which this geometric object is a member, as a string. E.g. "POLYGON", "LINESTRING", "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.15.1.4

Examples

SELECT GeometryType(ST_GeomFromText('GEOMETRYCOLLECTION(POINT (5 5 10),LINESTRING (0 0 10, 0 50 10))')); 
--Result
GEOMETRYCOLLECTION

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

Related functions

ST_GeometryType