Sets the pixel size 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 size on the X scale in the spatial reference system. |
scaleY | The pixel size on the Y scale in the spatial reference system. |
scaleXY | The pixel size on both the X and Y scales in the spatial reference system. Both scales are set to the same value. |
Examples
Set different scale values on the X and Y scales, 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;Output:
st_scalex | st_scaley
-----------+-----------
1.3 | 0.6