GeometryType — Restituisce il tipo di geometria come testo.
text GeometryType(geometry geomA);
Restituisce il tipo di geometria come stringa. Ad esempio: 'LINESTRING', 'POLYGON', 'MULTIPOINT', ecc.
OGC SPEC s2.1.1.1 - Restituisce il nome del sottotipo istanziabile di Geometry di cui questa istanza di Geometry è membro. Il nome del sottotipo istanziabile di Geometry viene restituito come stringa.
|
|
|
Questa funzione indica anche se la geometria è misurata, restituendo una stringa nella forma 'POINTM'. |
Migliorato: Nella 2.0.0 è stato introdotto il supporto per le superfici poliedriche, i triangoli e i TIN.
Questo metodo implementa le OGC Simple Features Implementation Specification for SQL 1.1.
Questo metodo supporta le Curve e le Circular String.
Questa funzione supporta il 3d e non distrugge gli z-index.
Questa funzione supporta le Polyhedral Surface.
Questa funzione supporta i Triangoli e le Triangulated Irregular Network Surfaces (TIN).
SELECT GeometryType(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'));
geometrytype
--------------
LINESTRING
SELECT ST_GeometryType(ST_GeomFromEWKT('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)) )'));
--result
POLYHEDRALSURFACE
SELECT GeometryType(geom) as result
FROM
(SELECT
ST_GeomFromEWKT('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
))
)') AS geom
) AS g;
result
--------
TIN