All Products
Search
Document Center

PolarDB:ST_PixelWidth

Last Updated:Mar 28, 2026

Returns the pixel width of a raster object in the spatial reference system.

Syntax

float8 ST_PixelWidth(raster raster_obj)

Parameters

ParameterDescription
raster_objThe 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.

ST_PixelWidth

Examples

select st_pixelwidth(rast), st_pixelheight(rast)
from raster_table;

Output:

 st_pixelwidth | st_pixelheight
---------------+----------------
            60 |             60