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
该方法实现了SQL/MM规范。 SQL-MM ISO/IEC 13249-3: 8.5
该函数支持 3d 并且不会丢失 z-index。
该函数支持多面体曲面。
此函数支持三角形和不规则三角网面 (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))