Sets the pixel widths of a raster object on the X and Y scales in the spatial reference system.
Syntax
raster ST_SetScale(raster raster_obj, float8 scaleX, float8 scaleY)
raster ST_SetScale(raster raster_obj, float8 scaleXY)Parameters
| Parameter | Description |
|---|---|
raster_obj | The raster object to update. |
scaleX | The pixel width of the raster object on the X scale in the spatial reference system. |
scaleY | The pixel width of the raster object on the Y scale in the spatial reference system. |
scaleXY | The pixel width of the raster object on the X and Y scales in the spatial reference system. Use this parameter to set the same scale on both axes. |
Example
Set the X scale to 1.3 and the Y scale to 0.6 for the raster object in raster_table where id = 2, then verify the result.
UPDATE raster_table
SET rast = ST_SetScale(rast, 1.3, 0.6)
WHERE id = 2;
SELECT ST_ScaleX(rast), ST_ScaleY(rast)
FROM raster_table
WHERE id = 2;Expected output:
st_scalex | st_scaley
-----------+-----------
1.3 | 0.6