This topic describes the ST_NumPatches function. This function returns the number of planes of the input geometry object.

Syntax

integer  ST_NumPatches(geometry  g1);

Parameters

Parameter Description
g1 The geometry object that you want to specify.

Description

  • If the input geometry object is not a polyhedral object, this function returns NULL.
  • This function is the alias of the ST_NumGeometries function. This function implements the SQL/MM specifications.
  • This function supports polyhedral surfaces.
  • This function supports 3D objects and does not delete z coordinates.

Examples

SELECT ST_NumPatches('POLYHEDRALSURFACE( ((0 0 0, 0 0 1, 0 1 1, 0 1 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);
 st_numpatches
---------------
             5
(1 row)