Name

CG_ApproximateMedialAxis — Calculer l'axe médian approximatif d'une géométrie aréolaire.

Synopsis

geometry CG_ApproximateMedialAxis(geometry geom);

geometry CG_ApproximateMedialAxis(geometry geom, boolean projected);

Description

Retourne un axe médian approximatif pour l'entrée aréolaire en se basant sur son squelette (straight skeleton). Utilise une API spécifique à SFCGAL lorsque compilée avec une version compatible (1.2.0+). Sinon, la fonction est juste un wrapper de CG_StraightSkeleton (cas le plus lent).

When projected is true, free endpoints of the medial axis are extended to reach the polygon boundary (projected medial axis). Requires SFCGAL 2.3.0+. When built against an older SFCGAL version, a notice is emitted and the non-projected result is returned instead.

Disponibilité : 3.5.0

Availability: 3.7.0 - projected parameter. Requires SFCGAL >= 2.3.0 for projected result; falls back to non-projected with a notice on older versions.

[Note]

Cette fonction ignore la dimension Z. Elle donne toujours un résultat en 2D, même lorsqu'elle est utilisée sur une géométrie en 3D.

Cette méthode nécessite le backend SFCGAL.

Cette fonction prend en charge les surfaces Polyhedral.

Cette fonction prend en charge les triangles et les réseaux irréguliers triangulés (TIN).

Exemples

SELECT CG_ApproximateMedialAxis(ST_GeomFromText('POLYGON (( 190 190, 10 190, 10 10, 190 10, 190 20, 160 30, 60 30, 60 130, 190 140, 190 190 ))'));

Un polygone et son axe médian approximatif

-- Projected medial axis: free endpoints extended to polygon boundary
SELECT CG_ApproximateMedialAxis('POLYGON((0 0,2 0,2 1,0 1,0 0))', true);
-- Result: MULTILINESTRING((0 0.5,2 0.5))