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.
|
|
|
인덱스는 1-기반입니다. |
|
|
|
모든 도형들을 추출하고자 한다면 ST_Dump 함수가 더 효율적입니다. |
2.0.0 버전부터 사용할 수 있습니다.
This method implements the SQL/MM specification. SQL-MM ISO/IEC 13249-3: 8.5
This function supports 3d and will not drop the z-index.
This function supports Polyhedral surfaces.
This function supports Triangles and Triangulated Irregular Network Surfaces (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))