All Products
Search
Document Center

ApsaraDB RDS:ST_SetSrid

Last Updated:Mar 28, 2026

Sets the spatial reference system identifier (SRID) of a raster object. The SRID and its definition are stored in the spatial_ref_sys table.

Syntax

raster ST_SetSrid(raster rast, integer srid);

Parameters

ParameterDescription
rastThe raster object.
sridThe SRID to assign to the raster object.

Usage notes

If the raster object is stored in external mode, it must be geographically referenced and the specified SRID must exist in the spatial_ref_sys table. If either condition is not met, the update fails.

Examples

The following example assigns SRID 4326 (WGS 84 geographic coordinate system) to the raster object in row 1 of the rast table.

UPDATE rast SET rast = ST_SetSrid(rast, 4326) WHERE id = 1;

Output:

(1 row)