名称

ST_MinimumBoundingCircle — 返回包含几何图形的最小圆形多边形。

概要

geometry ST_MinimumBoundingCircle(geometry geomA, integer num_segs_per_qt_circ=48);

描述

返回包含几何图形的最小圆形多边形。

[Note]

边界圆形由一个多边形近似,默认每个四分之一圆形有 48 个线段。由于多边形是对最小边界圆形的近似,因此输入几何图形中的一些点可能不会包含在多边形内。可以通过增加线段数量来改进近似值。对于近似值不适合的应用,可以使用 ST_MinimumBoundingRadius

ST_Collect 一起使用以获取一组几何图形的最小边界圆形。

要计算位于最小圆形上的两个点(“最大直径”),请使用 ST_LongestLine

多边形面积与其最小边界圆形面积之比称为 Reock 致密性得分

由 GEOS 模块执行。

可用性:1.4.0

示例

SELECT d.disease_type,
    ST_MinimumBoundingCircle(ST_Collect(d.geom)) As geom
    FROM disease_obs As d
    GROUP BY d.disease_type;

点和线字符串的最小边界圆形。使用 8 个线段来近似四分之一圆形

SELECT ST_AsText(ST_MinimumBoundingCircle(
        ST_Collect(
            ST_GeomFromText('LINESTRING(55 75,125 150)'),
                ST_Point(20, 80)), 8
                )) As wktmbc;
wktmbc
-----------
POLYGON((135.59714732062 115,134.384753327498 102.690357210921,130.79416296937 90.8537670908995,124.963360620072 79.9451031602111,117.116420743937 70.3835792560632,107.554896839789 62.5366393799277,96.6462329091006 56.70583703063,84.8096427890789 53.115246672502,72.5000000000001 51.9028526793802,60.1903572109213 53.1152466725019,48.3537670908996 56.7058370306299,37.4451031602112 62.5366393799276,27.8835792560632 70.383579256063,20.0366393799278 79.9451031602109,14.20583703063 90.8537670908993,10.615246672502 102.690357210921,9.40285267938019 115,10.6152466725019 127.309642789079,14.2058370306299 139.1462329091,20.0366393799275 150.054896839789,27.883579256063 159.616420743937,
37.4451031602108 167.463360620072,48.3537670908992 173.29416296937,60.190357210921 176.884753327498,
72.4999999999998 178.09714732062,84.8096427890786 176.884753327498,96.6462329091003 173.29416296937,107.554896839789 167.463360620072,
117.116420743937 159.616420743937,124.963360620072 150.054896839789,130.79416296937 139.146232909101,134.384753327498 127.309642789079,135.59714732062 115))
                

另请参阅

ST_Collect, ST_MinimumBoundingRadius, ST_LargestEmptyCircle, ST_LongestLine