Nom

ST_PatchN — Returns the Nth face of a PolyhedralSurface or TIN.

Synopsis

geometry ST_PatchN(geometry geomA, integer n);

Description

Returns the 1-based Nth face of a PolyhedralSurface or TIN. Returns NULL for other geometries or an out-of-range index. Use this function to access faces, because ST_GeometryN treats PolyhedralSurface and TIN as unitary geometries.

[Note]

L'indice est basé sur 1.

[Note]

Si vous voulez extraire tous les éléments d'une géométrie, ST_Dump est plus efficace.

Disponibilité : 2.0.0

Cette méthode implémente la spécification SQL/MM. SQL-MM ISO/IEC 13249-3 : 8.5

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).

Exemples

Extract the 2nd face of the polyhedral surface.

Code
SELECT ST_PatchN(geom, 2) As geomewkt
FROM (
VALUES ('POLYHEDRALSURFACE( ((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),
    ((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),
    ((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),
    ((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)),((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1)) )'::geometry) ) As foo(geom);
Export de raster
POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))
Figure
Geometry figure for visual-st-patchn-01