ST_GeometryType — Devuelve el tipo de geometría del valor de ST_Geometry.
text ST_GeometryType(geometry g1);
Devuelve el tipo de geometría como una cadena de texto. Por Ejemplo: 'ST_LineString', 'ST_Polygon','ST_MultiPolygon' etc. Esta función difiere de GeometryType(geometría) en este caso se devuelve la cadena de texto y ST delante, como el hecho de que no indicará como se mide la geometría.
Mejora: 2.0.0 se introdujo soporte de superficies poliédricas.
This method implements the SQL/MM specification. SQL-MM 3: 5.1.4
This function supports 3d and will not drop the z-index.
This function supports Polyhedral surfaces.
SELECT ST_GeometryType('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'::geometry);
ST_LineString
SELECT ST_GeometryType('POLYHEDRALSURFACE( ((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),
((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),
((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),
((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)),((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1)) )'::geometry);
ST_PolyhedralSurface
SELECT ST_GeometryType(geom) AS result
FROM
(SELECT
'TIN (((
0 0 0,
0 0 1,
0 1 0,
0 0 0
)),((
0 0 0,
0 1 0,
1 1 0,
0 0 0
))
)'::geometry AS geom
) AS g;
ST_Tin