All Products
Search
Document Center

AnalyticDB:ST_YMax

Last Updated:Mar 28, 2026

Returns the maximum Y coordinate of a raster.

Syntax

float8 ST_YMax(raster raster_obj)
float8 ST_YMax(raster raster_obj, integer pyramid)

Parameters

ParameterDescription
raster_objThe raster whose maximum Y coordinate you want to get.
pyramidThe pyramid level of the raster. Valid values start from 0.

Description

For a georeferenced raster, the function returns its maximum Y coordinate. For a raster without georeference information, the function returns a value that is equal to the height of the raster minus 1.

Examples

Get the maximum Y coordinate (no pyramid level specified)

SELECT ST_YMax(rast)
FROM raster_table;

Result:

 st_ymax
----------
      31

Get the maximum Y coordinate at a specific pyramid level

SELECT ST_YMax(rast, 1)
FROM raster_table;

What's next

  • ST_YMin: Returns the minimum Y coordinate of a raster.

  • ST_XMax: Returns the maximum X coordinate of a raster.

  • ST_XMin: Returns the minimum X coordinate of a raster.