> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RS_BandPixelType

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.
</Note>

Following are the possible values returned by RS\_BandPixelType:

1. `REAL_64BITS` - For Double values
2. `REAL_32BITS` - For Float values
3. `SIGNED_32BITS` - For Integer values
4. `SIGNED_16BITS` - For Short values
5. `UNSIGNED_16BITS` - For unsigned Short values
6. `UNSIGNED_8BITS` - For Byte values

## Signatures

```sql theme={"system"}
RS_BandPixelType(rast: Raster, band: Integer = 1)
```

## Parameters

<ParamField body="rast" type="Raster" required>
  The rast value.
</ParamField>

<ParamField body="band" type="Integer" required default="1">
  The band index.
</ParamField>

## Return type

<ResponseField type="String">
  A string representation.
</ResponseField>

## Examples

```sql theme={"system"}
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "D", 5, 5, 53, 51, 1, 1, 0, 0, 0), 2);
```

```
REAL_64BITS
```

```sql theme={"system"}
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "I", 5, 5, 53, 51, 1, 1, 0, 0, 0));
```

```
SIGNED_32BITS
```

```sql theme={"system"}
SELECT RS_BandPixelType(RS_MakeEmptyRaster(2, "I", 5, 5, 53, 51, 1, 1, 0, 0, 0), 3);
```

```
IllegalArgumentException: Provided band index 3 is not present in the raster
```
