ST_CellDepth

更新时间:
复制 MD 格式

Returns the pixel depth of a raster object as an integer. Pixel depth is the number of bits used to store each pixel value. A return value of 0 indicates an unknown pixel depth.

Syntax

integer ST_CellDepth(raster raster_obj);

Parameters

ParameterDescription
raster_objThe raster object.

Return value

An integer representing the pixel depth. Valid values: 0, 1, 2, 4, 8, 16, 32, 64.

ValueMeaning
0Unknown pixel depth
1, 2, 4, 8, 16, 32, 64Valid pixel depth values

Examples

Query the pixel depth of a raster object:

SELECT ST_CellDepth(raster_obj) AS pixel_depth FROM raster_table;

Output:

 pixel_depth
-------------
 8