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.
Availability: 2.0.0
この関数は3次元に対応し、Z値を削除しません。
このメソッドはOGC Simple Features Implementation Specification for SQL 1.1の実装です。
このメソッドは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)