名称

ST_NumPatches — Returns the number of faces in a PolyhedralSurface or TIN.

大纲

integer ST_NumPatches(geometry g1);

描述

Returns the number of faces in a PolyhedralSurface or TIN. Returns NULL for other geometries. Unlike ST_NumGeometries, this function counts individual faces.

可用性: 2.0.0

该函数支持 3d 并且不会丢失 z-index。

此方法实现了 SQL 1.1 的 OGC 简单功能规范。

该方法实现了SQL/MM规范。 SQL-MM ISO/IEC 13249-3: 8.5

该函数支持多面体曲面。

示例

Code
SELECT ST_NumPatches('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)) )');
栅格输出
st_numpatches
---------------
             6
(1 row)