ST_PatchN — Renvoie la Nième géométrie (face) d'une PolyhedralSurface.
geometry ST_PatchN(geometry geomA, integer n);
Renvoie la Nième géométrie (face) basée sur 1 si la géométrie est une POLYHEDRALSURFACE ou une POLYHEDRALSURFACEM. Sinon, elle renvoie NULL. Cette fonction renvoie la même réponse que ST_GeometryN pour PolyhedralSurfaces. L'utilisation de ST_GeometryN est plus rapide.
|
|
|
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.
Extract the 2nd face of the polyhedral surface.
SELECT ST_AsEWKT(ST_PatchN(geom, 2)) As geomewkt
FROM (
VALUES (ST_GeomFromEWKT('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)) )')) ) 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