Returns the maximum Y coordinate of a raster object.

## Syntax
```
HELPCODEESCAPE-sql
float8 ST_YMax(raster raster_obj)
float8 ST_YMax(raster raster_obj, integer pyramid)
```

## Parameters
<table> <thead> <tr> <th><b>Parameter</b></th> <th><b>Description</b></th> </tr> </thead> <tbody> <tr> <td><code>raster_obj</code></td> <td>The raster whose maximum Y coordinate you want to obtain.</td> </tr> <tr> <td><code>pyramid</code></td> <td>The pyramid level of the raster. Valid values start from 0.</td> </tr> </tbody> </table>

## Description
For a georeferenced raster, ST_YMax returns the maximum Y coordinate in the raster's spatial reference system. For a non-georeferenced raster, it returns the raster height minus 1.

## Example
```
HELPCODEESCAPE-sql
SELECT ST_YMax(rast)
FROM raster_table;
```

Output:

```
 st_ymax
----------
      31
```