Name

ST_PatchN — 返回多面体曲面的第N个几何图形(面)。

Synopsis

geometry ST_PatchN(geometry geomA, integer n);

描述

如果第N个几何图形是POLYHEDRALSURFACE或POLYHEDRALSURFACEM,则返回从1开始的第N个几何图形(面)。否则,返回NULL。这将返回与多面体曲面的ST_GeometryN相同的答案。使用ST_GeometryN更快。

[Note]

索引以1为基数。

[Note]

如果要提取几何图形的所有元素 ST_Dump 效率更高。

可用性:2.0.0

This method implements the SQL/MM specification. SQL-MM 3:?

This function supports 3d and will not drop the z-index.

This function supports Polyhedral surfaces.

示例

--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);

              geomewkt
---+-----------------------------------------
 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