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
该函数支持多面体曲面。
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)