RasterSummary¶
Calculates the basic statistics of the values of a raster: minimum, maximum, mean, standard deviation, range and sum, and optionally their histogram, with the number of cells for each interval of values. The no-data cells are not considered.
Parameters¶
Calculates the basic statistics of a raster: minimum, maximum, mean, standard deviation, range and sum of the values, and optionally their histogram.
Toolbox folder: Raster Processing
Status: Certified
Keywords: Statistics, Raster, Histogram
Authors: Andrea Antonello
Class: org.hortonmachine.modules.RasterSummary
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
The raster to analyze. |
||
|
int |
|
The number of bins of the histogram. |
|
|
boolean |
|
Also compute the histogram. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
Double |
The minimum value. |
|
|
Double |
The maximum value. |
|
|
Double |
The mean value. |
|
|
Double |
The standard deviation of the values. |
|
|
Double |
The range of the values, maximum minus minimum. |
|
|
Double |
The sum of the values. |
|
|
double[][] |
The histogram, as rows of bin center value and number of cells. |
Example¶
The example runs on the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data, each module on the outputs of the previous ones:
import org.hortonmachine.modules.RasterSummary
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
var summary = new RasterSummary()
summary.inRaster = folder + "dtm_flanginec.tif"
summary.process()
println "min: " + summary.outMin + " max: " + summary.outMax + " mean: " + summary.outMean + " sdev: " + summary.outSdev
For the sample elevation model, the minimum is 846 m, the maximum 2150 m, the mean 1575 m and the standard deviation 278 m.