跳转至
Apache Sedona 1.9.0 已正式发布,新增 Spark 4.1 支持、proj4sedona 坐标系转换、Bing Tile 函数等众多特性!

RS_SummaryStatsAll

Introduction: Returns summary stats struct consisting of count, sum, mean, stddev, min, max for a given band in raster. If band is not specified then it defaults to 1.

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

If the mentioned band index doesn't exist, this will throw an IllegalArgumentException.

Formats:

RS_SummaryStatsAll(raster: Raster, band: Integer = 1, excludeNoDataValue: Boolean = true)

RS_SummaryStatsAll(raster: Raster, band: Integer = 1)

RS_SummaryStatsAll(raster: Raster)

Return type: Struct<count: Long, sum: Double, mean: Double, stddev: Double, min: Double, max: Double>

Since: v1.5.0

SQL Example

SELECT RS_SummaryStatsAll(RS_MakeEmptyRaster(2, 5, 5, 0, 0, 1, -1, 0, 0, 0), 1, false)

Output:

{25.0, 204.0, 8.16, 9.4678403028357, 0.0, 25.0}

SQL Example

SELECT RS_SummaryStatsAll(RS_MakeEmptyRaster(2, 5, 5, 0, 0, 1, -1, 0, 0, 0), 1)

Output:

{14.0, 204.0, 14.571428571428571, 11.509091348732502, 1.0, 25.0}