CG_StraightSkeleton — Calcule un squelette (straight skeleton) à partir d'une géométrie
geometry CG_StraightSkeleton(
geometry geom, boolean use_distance_as_m = false)
;
Disponibilité : 3.5.0
Nécessite SFCGAL >= 1.3.8 pour l'option use_distance_as_m
Cette méthode nécessite le backend SFCGAL.
Cette fonction prend en charge la 3D et ne supprime pas l'indice z.
Cette fonction prend en charge les surfaces Polyhedral.
Cette fonction prend en charge les triangles et les réseaux irréguliers triangulés (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.
![]() Polygone d'origine |
![]() Squelette d'un polygone |