ST_MinimumBoundingCircle — 返回包含几何图形的最小圆形多边形。
geometry ST_MinimumBoundingCircle(
geometry geomA, integer num_segs_per_qt_circ=48)
;
返回包含几何图形的最小圆形多边形。
边界圆近似为多边形,默认情况下每四分之一圆有 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;
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))