Skip to main content

ST_CONVEXHULL

Introduced or updated: v1.2.564

Returns the convex hull of a GEOMETRY object.

Syntax

ST_CONVEXHULL(<geometry>)

Arguments

ArgumentsDescription
<geometry>The argument must be an expression of type GEOMETRY.

Return Type

GEOMETRY.

Examples

SELECT ST_ASTEXT(
ST_CONVEXHULL(
TO_GEOMETRY('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))')
)
) AS hull;

╭────────────────────────────────╮
│ hull │
├────────────────────────────────┤
POLYGON((2 0,2 2,0 2,0 0,2 0))
╰────────────────────────────────╯
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today