All Products
Search
Document Center

ApsaraDB RDS:ST_ConvexHull

Last Updated:Mar 28, 2026

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

ParameterDescription
sourceThe raster object whose convex hull you want to compute.
pyramidThe pyramid level of the raster. Valid values start from 0. Default value: 0.

Description

ST_ConvexHull returns the minimum convex geometry that encloses all geometries within a raster.

Minimum convex geometry

Examples

Basic usage — no pyramid level specified:

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))