Skip to content

ST_ConvexHull

Returns the Convex Hull of polygon A.

Usage

geometry ST_ConvexHull(geom: geometry)

Arguments

  • geom (geometry): Input geometry

Description

Returns the smallest convex polygon that encloses all points in the input geometry.

Examples

SELECT ST_ConvexHull(
  ST_GeomFromText('POLYGON((175 150, 20 40, 50 60, 125 100, 175 150))')
);
┌──────────────────────────────────────────────────────────────────────────────┐
│ st_convexhull(st_geomfromtext(Utf8("POLYGON((175 150, 20 40, 50 60, 125 100, │
│                                 175 150))")))…                               │
╞══════════════════════════════════════════════════════════════════════════════╡
│ POLYGON((20 40,175 150,125 100,20 40))                                       │
└──────────────────────────────────────────────────────────────────────────────┘