The ST_ConvexHull() function returns
the convex hull of any geometry object that has at least three
vertices forming a convex.
Syntax
ST_ConvexHull (g1 ST_ Geometry)
Usage
Creating a convex hull is often the first step when tessellating
a set of points to create a triangulated irregular network (TIN).
If vertices of the geometry do not form a convex, ST_ConvexHull() returns
a null.
ST_ConvexHull() generates
an ST_Polygon value from the convex hull of three of the geometries
that are pictured in the following figure. ST_ConvexHull() returns
a null for the two-point ST_LineString because it does not form a
convex hull. Figure 1: The
ST_ConvexHull() function.
Return type
ST_Geometry
Example
The example
creates the convexhull_test table that has two columns: geotype and g1.
The geotype column is of VARCHAR(20) type and holds the name
of the geometry subclass that is stored in g1, an ST_Geometry
column: