This topic describes the ST_MinimumBoundingCircle function. This function returns the smallest circle polygon object that can fully cover the geometry object. By default, this function uses 48 segments to approximate a quarter circle.
Syntax
geometry ST_MinimumBoundingCircle(geometry geomA , integer numSegsPerQtCirc);
Parameters
Parameter | Description |
---|---|
geomA | The geometry object that you want to specify. |
numSegsPerQtCirc | The number of segments that are used to approximate a quarter circle. Default value: 48. |
Description
- A larger value of the numSegsPerQtCirc parameter indicates a more accurate result, but the performance may deteriorate.
- In most cases, you can use this function to process MULTI and GeometryCollection objects. This function is not an aggregate function. However, you can use this function with the ST_Collect function to obtain the smallest bounding circle of a set of geometry objects. Example: ST_MinimumBoundingCircle(ST_Collect(somepointfield)).
Examples
Comparison between the smallest bounding circle object and the input geometry object:
select ST_CurveToLine(ST_MinimumBoundingCircle(g)),g from (select 'POLYGON((0 0,1 0,1 1,0 1,0 0))'::geometry as g) as t