All Products
Search
Document Center

PolarDB:ST_XMax

Last Updated:Mar 28, 2026

Returns the maximum X value of a raster object.

Syntax

float8 ST_XMax(raster raster_obj)

Parameters

ParameterDescription
raster_objThe raster object.

Description

The return value depends on whether the raster object is georeferenced:

  • Georeferenced raster: returns the maximum X coordinate in the spatial reference system.

  • Non-georeferenced raster: returns the width of the raster object minus 1.

Examples

Georeferenced raster

The following example returns the maximum X coordinate for a georeferenced raster stored in raster_table.

SELECT ST_XMax(rast)
FROM raster_table;

Result:

 st_xmax
----------
      121