Namn

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

Synopsis

geometry ST_PatchN(geometry geomA, integer n);

Beskrivning

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.

[Notera]

Index är 1-baserat.

[Notera]

Om du vill extrahera alla element i en geometri är ST_Dump mer effektivt.

Tillgänglighet: 2.0.0

Denna metod implementerar SQL/MM-specifikationen. SQL-MM ISO/IEC 13249-3: 8.5

Denna funktion stöder 3d och kommer inte att tappa z-index.

Denna funktion stöder polyedriska ytor.

Denna funktion stöder trianglar och triangulerade oregelbundna nätverksytor (TIN).

Exempel

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