Returns the minimum convex geometry that encloses all geometries within a raster.
Syntax
geometry ST_ConvexHull(raster source);
geometry ST_ConvexHull(raster source, integer pyramid);Parameters
| Parameter | Description |
|---|---|
| source | The raster whose minimum convex geometry you want to obtain. |
| pyramid | The pyramid level of the raster. Valid values start from 0. Default value: 0. |
Description
ST_ConvexHull computes the smallest convex polygon that encloses every geometry in the raster.

Examples
Return the convex hull of a raster object:
SELECT ST_AsText(ST_ConvexHull(rast_object))
FROM raster_table;
----------------------------------------------------
POLYGON((-180 90,180 90,180 -90,-180 -90,-180 90))Specify the pyramid level:
SELECT ST_AsText(ST_ConvexHull(rast_object, 1))
FROM raster_table;
----------------------------------------------------
POLYGON((-180 90,180 90,180 -90,-180 -90,-180 90))