ST_NumPatches

更新时间:
复制 MD 格式

Returns the number of planes of a polyhedral surface geometry.

Syntax

integer ST_NumPatches(geometry g1);

Parameters

ParameterDescription
g1The input geometry object.

Description

  • Returns NULL if the input is not a polyhedral surface.

  • This function is an alias for ST_NumGeometries.

  • Implements the SQL/MM specification.

  • Supports polyhedral surfaces.

  • Supports 3D objects and preserves 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
);

Result:

 st_numpatches
---------------
             5
(1 row)

See also

  • ST_NumGeometries: Returns the number of geometry objects in a collection, or 1 for single geometries.