RS_BandPixelType¶
Introduction: Returns the datatype of each pixel in the given band of the given raster in string format. The band parameter is 1-indexed. If no band is specified, band 1 is assumed.
Note
If the given band index does not exist in the given raster, RS_BandPixelType throws an IllegalArgumentException.
Following are the possible values returned by RS_BandPixelType:
REAL_64BITS- For Double valuesREAL_32BITS- For Float valuesSIGNED_32BITS- For Integer valuesSIGNED_16BITS- For Short valuesUNSIGNED_16BITS- For unsigned Short valuesUNSIGNED_8BITS- For Byte values
Format: RS_BandPixelType(rast: Raster, band: Integer = 1)
Since: v1.5.0
SQL Example
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "D", 5, 5, 53, 51, 1, 1, 0, 0, 0), 2);
Output:
REAL_64BITS
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "I", 5, 5, 53, 51, 1, 1, 0, 0, 0));
Output:
SIGNED_32BITS
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "I", 5, 5, 53, 51, 1, 1, 0, 0, 0), 3);
Output:
IllegalArgumentException: Provided band index 3 is not present in the raster