ST_MinimumBoundingCircle

更新时间:
复制 MD 格式

Returns the minimum bounding circle of a geometry object as a polygon. By default, 48 segments are used to approximate a quarter circle.

Syntax

geometry ST_MinimumBoundingCircle(geometry geomA, integer numSegsPerQtCirc);

Parameters

ParameterDescription
geomAThe input geometry object.
numSegsPerQtCircThe number of segments used to approximate a quarter circle. Default value: 48.

Description

  • A higher value of numSegsPerQtCirc produces a more accurate result but may reduce performance.

  • ST_MinimumBoundingCircle supports MULTI and GeometryCollection objects in most cases. It is not an aggregate function. To get the minimum bounding circle of a set of geometry objects, combine it with ST_Collect: ST_MinimumBoundingCircle(ST_Collect(somepointfield)).

Examples

The following example compares the minimum bounding circle with 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
1