Returns the maximum Y coordinate of a raster.
Syntax
float8 ST_YMax(raster raster_obj)
float8 ST_YMax(raster raster_obj, integer pyramid)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster whose maximum Y coordinate you want to get. |
pyramid | The 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
----------
31Get the maximum Y coordinate at a specific pyramid level
SELECT ST_YMax(rast, 1)
FROM raster_table;