RS_SummaryStats¶
Introduction: 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 bandsum: Sum of all pixel values in the specified bandmean: Mean value of all pixel values in the specified bandstddev: Standard deviation of all pixels in the specified bandmin: Minimum pixel value in the specified bandmax: 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.
Formats:
RS_SummaryStats(raster: Raster, statType: String, band: Integer = 1, excludeNoDataValue: Boolean = true)
RS_SummaryStats(raster: Raster, statType: String, band: Integer = 1)
RS_SummaryStats(raster: Raster, statType: String)
Since: v1.6.0
SQL Example
SELECT RS_SummaryStats(RS_MakeEmptyRaster(2, 5, 5, 0, 0, 1, -1, 0, 0, 0), "stddev", 1, false)
Output:
9.4678403028357