Amazon Redshift will no longer support the creation of new Python UDFs starting November 1, 2025.
If you would like to use Python UDFs, create the UDFs prior to that date.
Existing Python UDFs will continue to function as normal. For more information, see the
blog post
GeometryType
GeometryType returns the subtype of an input geometry as a string.
Syntax
GeometryType(geom)
Arguments
- geom
-
A value of data type
GEOMETRY
or an expression that evaluates to aGEOMETRY
type.
Return type
VARCHAR
representing the subtype of geom.
If geom is null, then null is returned.
The values returned are as follows.
Returned string value for 2D, 3DZ, 4D geometries | Returned string value for 3DM geometries | Geometry subtype |
---|---|---|
|
|
Returned if geom is a |
|
|
Returned if geom is a |
|
|
Returned if geom is a |
|
|
Returned if geom is a |
|
|
Returned if geom is a |
|
|
Returned if geom is a |
|
|
Returned if geom is a |
Examples
The following SQL converts a well-known text (WKT) representation of a polygon and
returns the GEOMETRY
subtype as a string.
SELECT GeometryType(ST_GeomFromText('POLYGON((0 2,1 1,0 -1,0 2))'));
geometrytype
-------------
POLYGON