Skip to content
πŸŽ‰ Apache Sedona 1.9.1 is out now! πŸ—ΊοΈ Geography SQL functions, Box2D & Box3D types, raster Python UDFs & more. Read the release notes β†’

GeometryType

Introduction: Returns the type of the geometry as a string. Eg: 'LINESTRING', 'POLYGON', 'MULTIPOINT', etc. This function also indicates if the geometry is measured, by returning a string of the form 'POINTM'.

GeometryType

Format: GeometryType (A: Geometry)

Return type: String

Since: v1.5.0

Example:

SELECT GeometryType(ST_GeomFromText('LINESTRING(77.29 29.07,77.42 29.26,77.27 29.31,77.29 29.07)'));

Result:

 geometrytype
--------------
 LINESTRING
SELECT GeometryType(ST_GeomFromText('POINTM(0 0 1)'));

Result:

 geometrytype
--------------
 POINTM