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 minimum 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;
POLYGON((72.5 178.4024474346694,84.86920388664029 177.18418718546332,96.76306620464646 173.57622349601382,107.72451249529237 167.71720838753708,117.33230052487836 159.83230052487838,125.21720838753708 150.22451249529237,131.07622349601382 139.26306620464646,134.68418718546332 127.3692038866403,135.9024474346694 115,134.68418718546332 102.63079611335971,131.07622349601382 90.73693379535354,125.21720838753708 79.77548750470766,117.33230052487838 70.16769947512164,107.72451249529237 62.282791612462916,96.76306620464648 56.42377650398619,84.86920388664032 52.815812814536685,72.50000000000001 51.59755256533059,60.13079611335969 52.815812814536685,48.236933795353536 56.42377650398618,37.27548750470765 62.28279161246291,27.667699475121637 70.16769947512162,19.782791612462923 79.77548750470763,13.923776503986204 90.7369337953535,10.315812814536692 102.63079611335968,9.097552565330588 114.99999999999999,10.315812814536685 127.3692038866403,13.923776503986197 139.2630662046465,19.78279161246291 150.22451249529234,27.667699475121623 159.83230052487835,37.275487504707634 167.71720838753708,48.236933795353494 173.5762234960138,60.13079611335967 177.18418718546332,72.49999999999999 178.4024474346694))