---
name: "pkstatogr"
section: "1"
platform: "linux"
package: "pktools"
version: "2.6.7.6+ds-6+b3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pkstatogr"
---

# pkstatogr(1)

program to calculate basic statistics from vector file

## NAME

pkstatogr - program to calculate basic statistics from vector file

## SYNOPSIS

FC**pkstatogr**F\[0\]  FC**-i**F\[0\] *input* \[*options*\]

## DESCRIPTION

**pkstatogr** calculates basic statistics on attributes of a vector file. Examples of the basic statistics include: minimum, maximum, median, mean and standard deviation. Histograms (in percentage or absolute values) can also be calculated. The attribute of interest can be selected using the option FC**-n**F\[0\]\|FC**--fname**F\[0\]. Values defined by the FC**-nodata**F\[0\] option, or not within the limits set by the options FC**-src\_min**F\[0\] and FC**-src\_max**F\[0\] are ignored for the statistics.

## OPTIONS

- FC**-i**F\[0\] *filename*, FC**--input**F\[0\] *filename*

  Input image file(s). If input contains multiple images, a multi-band output is created

- FC**-ln**F\[0\] *layer*, FC**--lname**F\[0\] *layer*

  Layer name(s) in sample (leave empty to select all)

- FC**-n**F\[0\] *attribute*, FC**--fname**F\[0\] *attribute*

  Fields on which to calculate statistics

- FC**-nodata**F\[0\] *value*, FC**--nodata**F\[0\] *value*

  Set nodata value(s)

- FC**-src\_min**F\[0\] *value*, FC**--src\_min**F\[0\] *value*

  Set minimum value for histogram

- FC**-src\_max**F\[0\] *value*, FC**--src\_max**F\[0\] *value*

  Set maximum value for histogram

- FC**-s**F\[0\], FC**--size**F\[0\]

  Sample size (number of points)

- FC**-mm**F\[0\], FC**--minmax**F\[0\]

  Calculate minimum and maximum value

- FC**-min**F\[0\], FC**--min**F\[0\]

  Calculate minimum value

- FC**-max**F\[0\], FC**--max**F\[0\]

  Calculate maximum value

- FC**-mean**F\[0\], FC**--mean**F\[0\]

  Calculate mean

- FC**-median**F\[0\], FC**--median**F\[0\]

  Calculate median

- FC**-stdev**F\[0\], FC**--stdev**F\[0\]

  Calculate standard deviation

- FC**-hist**F\[0\], FC**--hist**F\[0\]

  Calculate histogram

- FC**-nbin**F\[0\] *value*, FC**--nbin**F\[0\] *value*

  Number of bins to calculate histogram

- FC**-rel**F\[0\], FC**--relative**F\[0\]

  Use percentiles for histogram to calculate histogram

- FC**-kde**F\[0\], FC**--kde**F\[0\]

  Use Kernel ⟨http://pktools.nongnu.org/html/classKernel.html⟩ density estimation when producing histogram. The standard deviation is estimated based on Silverman's rule of thumb

- FC**-v**F\[0\] *level*, FC**--verbose**F\[0\] *level*

  Verbose level

## EXAMPLE

report histogram of values in FIELDID (to standard output)

```
FC
pkstatogr -i input.shp -f FIELDID -n 100
      F[0]
```

report min, max, mean and standard deviation of values in FIELDID (to standard output)

```
FC
pkstatogr -i input.shp -f FIELDID -min -max -mean -stdev
      F[0]
```
