ST_PatchN — Returns the Nth face of a PolyhedralSurface or TIN.
geometry ST_PatchN(geometry geomA, integer n);
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.
|
|
|
L'indice est basé sur 1. |
|
|
|
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).
Extract the 2nd face of the polyhedral surface.
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);
POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))
ST_AsEWKT, ST_GeomFromEWKT, ST_Dump, ST_GeometryN, ST_NumGeometries, ST_NumPatches