Description
The ST_ConvexHull
function computes the convex hull of a geometry. The
convex hull is the smallest convex geometry that contains all the points in the input
geometry.
Syntax
ST_ConvexHull(WritableGeometry geometry)
Parameters
Parameter |
Type |
Description |
geometry
|
WritableGeometry |
The input geometry. |
Return Values
Return Type |
Description |
WritableGeometry |
The convex hull of the geometry. |
Examples
SELECT ST_ConvexHull(ST_GeomFromWKT(geometry, 'epsg:4326')) FROM table;
SELECT ST_ToWKT(ST_ConvexHull(ST_GeomFromWKT(table.geometry,'epsg:4267'))) AS result FROM table;
SELECT ST_ConvexHull(ST_GeomFromWKT('MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)),
((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))'),'epsg:4267');