Name

ST_ConvexHull — Returns a geometry that represents the convex hull of the given Geometry.

Synopsis

geometry ST_ConvexHull(bytea Geometry);

Alias

ConvexHull

Description

Returns a geometry that represents the convex hull of the given Geometry.

The convex hull represents the boundary of the minimal convex set containing a given geometry. It may be easily visualized by imagining an elastic band stretched open to encompass the given object.

[Note]

This method supports GeometryCollections

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
2.1.1.37.2.21.17.2.8.15.1.16

Examples

SELECT ST_asewkt(ST_ConvexHull(ST_GeomfromText(
'GEOMETRYCOLLECTION (POINT (2 2), POINT (2 5), POINT(5 3), POINT (6 5),POLYGON ((3 4, 3.2 6, 2.8 7.4, 5.1 7.1, 4.4 4.5, 3 4)))'
)));
                       st_asewkt
-------------------------------------------------------
 POLYGON ((2 2, 2 5, 2.8 7.4, 5.1 7.1, 6 5, 5 3, 2 2))
(1 row)

Related functions

ST_MinimumBoundingCircle