All Products
Search
Document Center

PolarDB:ST_SetUpperLeft

Last Updated:Mar 28, 2026

Sets the upper-left X and Y coordinates of a raster object in the spatial reference system.

Syntax

raster ST_SetUpperLeft(raster raster_obj,  float8 upperleftX, float8 upperleftY)
raster ST_SetUpperLeft(raster raster_obj,  float8 upperleftXY)

Parameters

ParameterDescription
raster_objThe name of the raster object.
upperleftXThe upper-left X coordinate in the spatial reference system.
upperleftYThe upper-left Y coordinate in the spatial reference system.
upperleftXYThe upper-left X and Y coordinates in the spatial reference system. This parameter specifies the same upper-left X and Y coordinates.

Examples

The following example sets the upper-left coordinates of the raster in raster_table where id = 2 to X=120, Y=30, then verifies the result.

UPDATE raster_table
SET rast = ST_SetUpperleft(rast, 120, 30)
WHERE id = 2;

select st_upperleftx(rast), st_upperlefty(rast)
from raster_table
WHERE id = 2;

 st_upperleftx | st_upperlefty
---------------+---------------
          120  |            30