📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

ST_CONVEXHULL



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)) │ ╰────────────────────────────────╯

Was this page helpful?