ST_PixelWidth

更新时间:
复制 MD 格式

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

Syntax

float8 ST_PixelWidth(raster raster_obj)

Parameters

ParameterDescription
raster_objThe name of the raster object.

Description

The red region in the diagram below illustrates what the pixel width represents.

ST_PixelWidth

When the skew of the raster object is 0, the pixel width equals the X scale.

Examples

The following example queries the pixel width and pixel height of each raster object in raster_table.

SELECT st_pixelwidth(rast), st_pixelheight(rast)
FROM raster_table;

Result:

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