CG_OptimalConvexPartition — 計算多邊形幾何的最佳凸分割
geometry CG_OptimalConvexPartition(
geometry geom)
;
計算多邊形幾何的最佳凸分割。
![]() |
|
多邊形 P 的分割是一組多邊形,其內部不相交,且這些多邊形的聯集等於原始多邊形 P 的內部。CG_OptimalConvexPartition 產生一個在塊數上最佳的分割。 |
可用性:3.5.0 - 需要 SFCGAL >= 1.5.0。
需要 SFCGAL >= 1.5.0
此方法需要 SFCGAL 後端。
最佳凸分割 (與 CG_YMonotonePartition、CG_ApproxConvexPartition 和 CG_GreeneApproxConvexPartition 相同的範例)
SELECT ST_AsText(CG_OptimalConvexPartition('POLYGON((156 150,83 181,89 131,148 120,107 61,32 159,0 45,41 86,45 1,177 2,67 24,109 31,170 60,180 110,156 150))'::geometry));
GEOMETRYCOLLECTION(POLYGON((156 150,83 181,89 131,148 120,156 150)),POLYGON((32 159,0 45,41 86,32 159)),POLYGON((45 1,177 2,67 24,45 1)),POLYGON((41 86,45 1,67 24,41 86)),POLYGON((107 61,32 159,41 86,67 24,109 31,107 61)),POLYGON((148 120,107 61,109 31,170 60,180 110,148 120)),POLYGON((156 150,148 120,180 110,156 150)))