> ## 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_SummaryStats

Returns summary statistic for a particular band based on the `statType` parameter. The function defaults to band index of `1` when `band` is not specified and excludes noDataValue if `excludeNoDataValue` is not specified.

`statType` parameter takes the following strings:

* `count`: Total count of all pixels in the specified band
* `sum`: Sum of all pixel values in the specified band
* `mean`: Mean value of all pixel values in the specified band
* `stddev`: Standard deviation of all pixels in the specified band
* `min`: Minimum pixel value in the specified band
* `max`: Maximum pixel value in the specified band

<Note>
  If excludeNoDataValue is set `true` then it will only count pixels with value not equal to the nodata value of the raster.
  Set excludeNoDataValue to `false` to get count of all pixels in raster.
</Note>

## Signatures

```sql theme={"system"}
RS_SummaryStats(raster: Raster, statType: String, band: Integer = 1, excludeNoDataValue: Boolean = true)
```

```sql theme={"system"}
RS_SummaryStats(raster: Raster, statType: String, band: Integer = 1)
```

```sql theme={"system"}
RS_SummaryStats(raster: Raster, statType: String)
```

## Parameters

<ParamField body="raster" type="Raster" required>
  The input raster.
</ParamField>

<ParamField body="statType" type="String" required>
  The stat type value.
</ParamField>

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

<ParamField body="excludeNoDataValue" type="Boolean" default="true">
  Whether to exclude NoData pixels from the calculation.
</ParamField>

## Return type

<ResponseField type="Double">
  A numeric value.
</ResponseField>

## Example

```sql theme={"system"}
SELECT RS_SummaryStats(RS_MakeEmptyRaster(2, 5, 5, 0, 0, 1, -1, 0, 0, 0), "stddev", 1, false)
```

```
9.4678403028357
```
