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 raster object to query. |
Description
ST_PixelWidth returns the width of a pixel in the geometric units of the spatial reference system. If the skew of the raster object is 0, the pixel width is equal to the X scale.
The following diagram shows the pixel width (highlighted in red) of a raster object.

Examples
select st_pixelwidth(rast), st_pixelheight(rast)
from raster_table;Output:
st_pixelwidth | st_pixelheight
---------------+----------------
60 | 60