ST_ZMax

更新时间:
复制 MD 格式

Returns the maximum z-coordinate of the bounding box of a Box2D, Box3D, or geometry object.

Syntax

float ST_ZMax(box3d aGeomorBox2DorBox3D);

Parameters

ParameterDescription
aGeomorBox2DorBox3DThe Box2D, Box3D, or geometry object.

Usage notes

  • The parameter type is defined as box3d, but ST_ZMax supports auto-casting for Box2D and geometry objects. If a Box2D or geometry object is passed as a string, auto-casting does not apply and the function cannot process it.

  • ST_ZMax preserves z-coordinates and does not drop them from 3D objects.

  • ST_ZMax supports circular strings and curves.

Examples

Get the maximum z-coordinate of a LineString:

SELECT ST_ZMax('LINESTRING(0 1 2,3 4 5)'::geometry);
 st_zmax
---------
       5
(1 row)