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
ST_GeometryType
ST_GeometryType returns the subtype of an input geometry as a string.
For 3DM, 3DZ, and 4D geometry inputs, ST_GeometryType returns the same result as for 2D geometry inputs.
Syntax
ST_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 | 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 returns the subtype of the input linestring geometry.
SELECT ST_GeometryType(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'));
st_geometrytype
-------------
ST_LineString