GeometryType - Amazon Redshift

Amazon Redshift non supporterà più la creazione di nuovi Python a UDFs partire dal 1° novembre 2025. Se vuoi usare Python UDFs, crea la UDFs data precedente a quella data. Python esistente UDFs continuerà a funzionare normalmente. 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)

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