Skip to content
🎉 Apache Sedona 1.8.1 is now available! Check out the new features and improvements.

ST_NumGeometries

Introduction: Returns the number of Geometries. If geometry is a GEOMETRYCOLLECTION (or MULTI*) return the number of geometries, for single geometries will return 1.

Format: ST_NumGeometries (A: Geometry)

Since: v1.3.0

Example

SELECT ST_NumGeometries(ST_GeomFromWKT('LINESTRING (-29 -27, -30 -29.7, -45 -33)'))

Output:

1