ST_GeometryType — Restituisce il tipo di geometria per il valore ST_Geometry.
text ST_GeometryType(geometry g1);
Restituisce il tipo di geometria come stringa. P. es.: 'ST_LineString', 'ST_Polygon','ST_MultiPolygon' ecc. Questa funzione differisce da GeometryType(geometry) per il prefisso ST che viene restituito, così come per il fatto che non indica se la geometria è misurata.
Miglioramento: nella versione 2.0.0 è stato introdotto il supporto per le superfici poliedriche.
Questo metodo implementa la specifica SQL/MM. SQL-MM 3: 5.1.4
Questa funzione supporta il 3d e non distrugge gli z-index.
Questa funzione supporta le Polyhedral Surface.
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