

 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](https://aws.amazon.com/blogs/big-data/amazon-redshift-python-user-defined-functions-will-reach-end-of-support-after-june-30-2026/). 

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
<a name="GeometryType-function"></a>

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

## Sintassi
<a name="GeometryType-function-syntax"></a>

```
GeometryType(geom)
```

## Arguments (Argomenti)
<a name="GeometryType-function-arguments"></a>

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

## Tipo restituito
<a name="GeometryType-function-return"></a>

`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
<a name="GeometryType-function-examples"></a>

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
```