Name

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

Übersicht

geometry ST_PatchN(geometry geomA, integer n);

Beschreibung

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.

[Anmerkung]

Der Index ist auf 1 basiert.

[Anmerkung]

Falls Sie alle Geometrien einer Geometrie entnehmen wollen, so ist ST_Dump wesentlich leistungsfähiger.

Verfügbarkeit: 2.0.0

Diese Methode setzt die SQL/MM-Spezifikation um. SQL-MM ISO/IEC 13249-3: 8.5

Diese Funktion unterstützt 3d und lässt den Z-Index nicht fallen.

Diese Funktion unterstützt polyedrische Flächen.

Diese Funktion unterstützt Dreiecke und dreieckige unregelmäßige Netzoberflächen (TIN).

Beispiele

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);
Ausgabe von Rastern
POLYGON((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0))
Figure
Geometry figure for visual-st-patchn-01