All Products
Search
Document Center

ApsaraDB RDS:ST_YMax

Last Updated:Mar 28, 2026

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

Syntax

float ST_YMax(box3d aGeomorBox2DorBox3D);

Parameters

ParameterDescription
aGeomorBox2DorBox3DThe Box2D, Box3D, or geometry object.

Usage notes

  • The parameter type is defined as box3d, but ST_YMax supports auto-casting for Box2D and geometry objects. Auto-casting does not apply when Box2D or geometry objects are passed as strings.

  • Supports 3D objects and preserves z coordinates.

  • Supports circular strings and curves.

Examples

Get the maximum y coordinate of the bounding box of a LineString:

SELECT ST_YMax('LINESTRING(0 1,2 3)'::geometry);
 st_ymax
---------
       3
(1 row)