ST_GeometryTypeID function

The ST_GeometryTypeID function retrieves the numeric type associated with the geometry.

Syntax

Read syntax diagramSkip visual syntax diagram ST_GeometryTypeID ( geometry )

Parameter

geometry
A value of type ST_Geometry for which the number associated with the geometry type is to be returned.

Return type

Returns an integer for the geometry type of the specified geometry.

Example

create table points (pk integer not null primary key, geo ST_Point)

insert into points values(1, st_point(10,10, 1))

select st_geometrytypeid(geo) as type from points 

Result
TYPE
-----------          
          4
          
1 record(s) selected.