Histogram
The Histogram is a plot operator that computes a histogram plot either over attributes of a vector dataset or values of a raster source.
The output is a plot in Vega-Lite specification.
For instance, you want to plot the data distribution of numeric attributes of a feature collection. Then you can use a histogram with a suitable number of buckets to visualize and assess this.
Errors
Section titled “Errors”The operator returns an error if the selected column (columnName) does not exist or is not numeric.
If bounds or buckets are not defined, the operator will determine these values by itself which requires processing the data twice.
If the buckets parameter is set to squareRootChoiceRule, the operator estimates it using the square root of the number of elements in the data.
Parameters
Section titled “Parameters”| Name | Type | Description | Examples |
|---|---|---|---|
| bounds | HistogramBounds | If data, it computes the bounds of the underlying data.If { "min": ..., "max": ... }, one can specify custom bounds. | |
| buckets | HistogramBuckets | The number of buckets. The value can be specified or calculated. | |
| columnName | string | Name of the (numeric) vector attribute or raster band to compute the histogram on. | "temperature" |
| interactive | boolean | Flag, if the histogram should have user interactions for a range selection. It is false by default. | true |
Sources
Section titled “Sources”| Name | Type | Description |
|---|---|---|
| vector | SingleRasterOrVectorOperator | It is either a set of RasterOperator or a single VectorOperator |
Examples
Section titled “Examples”{ "type": "Histogram", "params": { "columnName": "foobar", "bounds": { "min": 5, "max": 10 }, "buckets": { "type": "number", "value": 15 }, "interactive": false }, "sources": { "vector": { "type": "OgrSource", "params": { "data": "ndvi" } } }}