CG_StraightSkeleton — 从几何体计算直骨架
geometry CG_StraightSkeleton(
geometry geom, boolean use_distance_as_m = false)
;
可用性:3.5.0
要使用任意参数 use_distance_as_m,需要 SFCGAL >= 1.3.8
该方法需要SFCGAL后端。
该函数支持 3d 并且不会丢失 z-index。
该函数支持多面体曲面。
此函数支持三角形和不规则三角网面 (TIN)。
SELECT CG_StraightSkeleton(ST_GeomFromText('POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20, 160 30, 60 30, 60 130, 190 140, 190 190 ))'));
SELECT ST_AsText(CG_StraightSkeleton('POLYGON((0 0,1 0,1 1,0 1,0 0))', true); MULTILINESTRING M ((0 0 0,0.5 0.5 0.5),(1 0 0,0.5 0.5 0.5),(1 1 0,0.5 0.5 0.5),(0 1 0,0.5 0.5 0.5))
Note that valid inputs with rings that touch at a single point will raise an error.
SELECT CG_StraightSkeleton( 'POLYGON((0 0, 3 0, 3 3, 0 3, 0 0), (0 0, 1 2, 2 1, 0 0))')); NOTICE: During straight_skeleton(A) : NOTICE: with A: POLYGON((0/1 0/1,3/1 0/1,3/1 3/1,0/1 3/1,0/1 0/1),(0/1 0/1,1/1 2/1,2/1 1/1,0/1 0/1)) ERROR: straight skeleton of Polygon with point touching rings is not implemented.
![]() 原始多边形 |
![]() 多边形的直骨架 |