Returns the number of planes of a polyhedral surface geometry.
Syntax
integer ST_NumPatches(geometry g1);Parameters
| Parameter | Description |
|---|---|
g1 | The input geometry object. |
Description
Returns
NULLif 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.
该文章对您有帮助吗?