Returns the maximum X coordinate of a georeferenced raster object. If the raster has not been georeferenced, the function returns -1, indicating that no geographic reference information is available.
Syntax
float8 ST_XMax(raster raster_obj)
float8 ST_XMax(raster raster_obj, integer pyramid)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object whose maximum X coordinate you want to retrieve. |
pyramid | The pyramid level at which to evaluate the raster. Valid values start from 0. |
Examples
Basic usage — retrieve the maximum X coordinate from all rows in a raster table:
SELECT ST_XMax(rast)
FROM raster_table;
st_xmax
----------
121With pyramid level — retrieve the maximum X coordinate at a specific pyramid level:
SELECT ST_XMax(rast, 2)
FROM raster_table;See also
Use ST_XMax together with the following functions to retrieve the full geographic extent of a raster object: