Nome

GeometryType — Restituisce il tipo di geometria come testo.

Sinossi

text GeometryType(geometry geomA);

Descrizione

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.

[Nota]

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).

Esempi

Code
SELECT GeometryType('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'::geometry);
Output
LINESTRING
Figure
Geometry figure for visual-geometrytype-01
Code
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)) )');
    POLYHEDRALSURFACE
            
Code
SELECT 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;
Output
TIN
Figure
Geometry figure for visual-geometrytype-02

Si veda anche

ST_GeometryType