Name

ST_ZSize — Returns the Z size of a 2D or 3D bounding box or a geometry.

Synopsis

float ST_ZSize(box3d aGeomorBox2DorBox3D);

Description

Returns the Z size of a 2D or 3D bounding box or a geometry, computed as ST_ZMax(aGeomorBox2DorBox3D) - ST_ZMin(aGeomorBox2DorBox3D).

[Note]

Although this function is only defined for box3d, it also works for box2d and geometry values due to automatic casting. However it will not accept a geometry or box2d text representation, since those do not auto-cast.

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves.

Availability: 3.7.0

Examples

SELECT ST_ZSize('BOX3D(1 2 3, 4 5 6)');
st_zsize
--------
3

SELECT ST_ZSize(ST_GeomFromEWKT('LINESTRING(1 3 4, 5 6 7)'));
st_zsize
--------
3