Returns the pixel width of a raster object in the spatial reference system.
Syntax
float8 ST_PixelWidth(raster raster_obj)Parameters
| Parameter | Description |
|---|---|
| raster_obj | The name of the raster object. |
Description
The red part in the following figure shows the pixel width of the raster object. When the skew of the raster object is 0, the pixel width equals the X scale.

Examples
Query the pixel width and pixel height of raster objects in raster_table:
select st_pixelwidth(rast), st_pixelheight(rast)
from raster_table;Output:
st_pixelwidth | st_pixelheight
---------------+----------------
60 | 60