ST_CONVEXHULL()

All functions > GEOSPATIAL > ST_CONVEXHULL()

Returns the convex hull of a geometry or geography.

Signatures

Convex hull

Returns: Convex hull; sub kind depends on input (Point → Point, collinear → LineString, otherwise → Polygon)

ST_CONVEXHULL(geo: T) → GEOMETRY or GEOGRAPHY
sql
ParameterTypeRequiredDescription
geoTYesGeometry or geography value

With:

  • T : Custom types: GEOM_POINT | GEOM_LINESTRING | GEOM_POLYGON | GEOM_MULTIPOINT | GEOM_MULTILINESTRING | GEOM_MULTIPOLYGON | GEOM_MULTIANY | GEOG_POINT | GEOG_LINESTRING | GEOG_POLYGON | GEOG_MULTIPOINT | GEOG_MULTILINESTRING | GEOG_MULTIPOLYGON | GEOG_MULTIANY

Signature notes:

  • Single Point returns the same Point
  • Collinear points return a LineString
  • Returns NULL if the input is NULL

Examples

FeatureQL
SELECT
    f1 := ST_ASTEXT(ST_CONVEXHULL(ST_GEOMFROMTEXT('MULTIPOINT ((0 0), (1 0), (0 1))'))) -- Convex hull of three points
;
Result
f1 VARCHAR
POLYGON ((0 0, 0 1, 1 0, 0 0))

Last update at: 2026/05/26 17:22:09