rio sample

Sample a dataset at one or more points

Sampling points (x, y) encoded as JSON arrays, in the coordinate reference system of the dataset, are read from the second positional argument or stdin. Values of the dataset’s bands are also encoded as JSON arrays and are written to stdout.

Example:

$ cat << EOF | rio sample tests/data/RGB.byte.tif
> [220650, 2719200]
> [219650, 2718200]
> EOF
[28, 29, 27]
[25, 29, 19]

By default, rio-sample will sample all bands. Optionally, bands may be specified using a simple syntax:

–bidx N samples the Nth band (first band is 1).

—bidx M,N,0 samples bands M, N, and O.

–bidx M..O samples bands M-O, inclusive.

—bidx ..N samples all bands up to and including N.

–bidx N.. samples all bands from N to the end.

Example:

$ cat << EOF | rio sample tests/data/RGB.byte.tif –bidx ..2
> [220650, 2719200]
> [219650, 2718200]
> EOF
[28, 29]
[25, 29]
rio sample [OPTIONS] FILE "[x, y]"

Options

-b, --bidx <bidx>

Indexes of input file bands.

Arguments

FILE "[x, y]"

Required argument(s)