Name

ST_MinimumBoundingCircle — Returns the smallest circle polygon that contains a geometry.

Synopsis

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

설명

Returns the smallest circle polygon that contains a geometry.

[Note]

사분원 당 구간 48개라는 기본값으로 원에 가까운 폴리곤을 생성합니다. 이 폴리곤이 최소 경계 원(minimum bounding circle)의 근사치이기 때문에, 입력 도형 안에 있는 포인트 몇 개는 폴리곤 내부에 담기지 않을 수도 있습니다. 구간의 개수를 늘리면 성능을 거의 저하시키지 않고도 근사치를 향상시킬 수 있습니다. 폴리곤 근사치가 적당하지 않은 경우, ST_MinimumBoundingRadius 함수를 사용할 수도 있습니다.

Use with ST_Collect to get the minimum bounding circle of a set of geometries.

To compute two points lying on the mimimum circle (the "maximum diameter") use ST_LongestLine.

폴리곤의 면적을 최소 경계 원의 면적으로 나눈 비율을 종종 루크(Roeck) 테스트라고 부릅니다.

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))