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

inRaster

raster file

The raster to analyze.

pBins

int

100

The number of bins of the histogram.

doHistogram

boolean

false

Also compute the histogram.

Outputs

Parameter

Type

Unit

Description

outMin

Double

The minimum value.

outMax

Double

The maximum value.

outMean

Double

The mean value.

outSdev

Double

The standard deviation of the values.

outRange

Double

The range of the values, maximum minus minimum.

outSum

Double

The sum of the values.

outCb

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.