GeometryType - Amazon Redshift

Amazon Redshift non supporterà più la creazione di nuovi Python UDFs a partire dalla Patch 198. Python esistente UDFs continuerà a funzionare fino al 30 giugno 2026. Per ulteriori informazioni, consulta il post del blog.

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

GeometryType

GeometryType restituisce il sottotipo di una geometria di input come stringa.

Sintassi

GeometryType(geom)

Arguments (Argomenti)

geom

Un valore di tipo GEOMETRY o un'espressione che restituisce un valore di tipo GEOMETRY.

Tipo restituito

VARCHAR che rappresenta il sottotipo di geom.

Se geom è nullo, allora viene restituito il valore nullo.

I valori restituiti sono i seguenti.

Valore stringa restituito per geometrie 2D, 3DZ, 4D Valore stringa restituito per geometrie 3DM Sottotipo dato di tipo geometry

POINT

POINTM

Restituito se geom è di sottotipo POINT

LINESTRING

LINESTRINGM

Restituito se geom è di sottotipo LINESTRING

POLYGON

POLYGONM

Restituito se geom è di sottotipo POLYGON

MULTIPOINT

MULTIPOINTM

Restituito se geom è di sottotipo MULTIPOINT

MULTILINESTRING

MULTILINESTRINGM

Restituito se geom è di sottotipo MULTILINESTRING

MULTIPOLYGON

MULTIPOLYGONM

Restituito se geom è di sottotipo MULTIPOLYGON

GEOMETRYCOLLECTION

GEOMETRYCOLLECTIONM

Restituito se geom è di sottotipo GEOMETRYCOLLECTION

Esempi

Il seguente comando SQL converte una rappresentazione in formato Well-Known Text (WKT) di un poligono e restituisce il sottotipo GEOMETRY come stringa.

SELECT GeometryType(ST_GeomFromText('POLYGON((0 2,1 1,0 -1,0 2))'));
geometrytype ------------- POLYGON