CG_StraightSkeleton — Compute a straight skeleton from a geometry
geometry CG_StraightSkeleton(
geometry geom, boolean use_distance_as_m = false)
;
Availability: 3.5.0
Requires SFCGAL >= 1.3.8 for option use_distance_as_m
Questo metodo richiede il backend SFCGAL.
Questa funzione supporta il 3d e non distrugge gli z-index.
Questa funzione supporta le Polyhedral Surface.
Questa funzione supporta i Triangoli e le Triangulated Irregular Network Surfaces (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.
![]() Original polygon |
![]() Straight Skeleton of polygon |