Name

ST_BandPixelType — Returns the type of pixel for given band. If no bandnum specified, 1 is assumed.

Synopsis

text ST_BandPixelType(raster rast, integer bandnum=1);

Description

Returns name describing data type and size of values stored in each cell of given band.

There are 11 pixel types. Pixel Types supported are as follows:

  • 1BB - 1-bit boolean

  • 2BUI - 2-bit unsigned integer

  • 4BUI - 4-bit unsigned integer

  • 8BSI - 8-bit signed integer

  • 8BUI - 8-bit unsigned integer

  • 16BSI - 16-bit signed integer

  • 16BUI - 16-bit unsigned integer

  • 32BSI - 32-bit signed integer

  • 32BUI - 32-bit unsigned integer

  • 32BF - 32-bit float

  • 64BF - 64-bit float

Examples

SELECT ST_BandPixelType(rast,1) As btype1,
    ST_BandPixelType(rast,2) As btype2, ST_BandPixelType(rast,3) As btype3
FROM dummy_rast
WHERE rid = 2;

 btype1 | btype2 | btype3
--------+--------+--------
 8BUI   | 8BUI   | 8BUI
                

See Also

ST_NumBands