Returns the center point and radius of the minimum bounding circle that encloses the input geometry object.
Syntax
(geometry, double precision) ST_MinimumBoundingRadius(geometry geom);Parameters
| Parameter | Description |
|---|---|
geom | The geometry object to compute the minimum bounding circle for. |
Return value
Returns a composite row with two fields:
| Field | Type | Description |
|---|---|---|
center | geometry | The center point of the minimum bounding circle. |
radius | double precision | The radius of the minimum bounding circle. |
Usage notes
Use ST_MinimumBoundingRadius with ST_Collect to compute the minimum bounding circle of a set of geometry objects.
Examples
The following example computes the minimum bounding circle of a diamond-shaped polygon. The result shows the center point and radius of the circle.
SELECT ST_AsText(center), radius
FROM ST_MinimumBoundingRadius('POLYGON((0 1,-1 0,0 -1,1 0,0 1))'::geometry);Output:
st_astext | radius
------------+--------
POINT(0 0) | 1
(1 row)该文章对您有帮助吗?