NAME

s.sample - Sample a raster file at site locations.
(GRASS Sites Program)

SYNOPSIS

s.sample
s.sample help
s.sample [-BCcdlq] input=name [output=name] rast=name [z=name]

DESCRIPTION

s.sample samples a GRASS raster map at the site locations in the input file by either cubic convolution interpolation, bilinear interpolation, or nearest neighbor sampling (default). Categories values are sampled.

This program may be especially useful when sampling for cross validation of interpolations whose output is a raster map.

OPTIONS

Flags:

-B
Use bilinear interpolation.
-C
Use cubic convolution interpolation.
-c
Use numeric category labels instead of category values.
-d
Calculate difference between raster value and site value (raster minus site).
-l
If site is in the E|N|#n label format (instead of the E|N|label format), use the numeric label as the site value. Implies the -d flag.
-q
Quiet. Cut out the chatter.

Parameters:

input=name
Name of sites list defining sample points.
output=name
Optional name of sites list in which output will be stored. Standard output is used if this is missing.
rast=name
Name of raster map to be sampled.
z=value
Option scaling factor for values read from raster map. Sampled values will be multiplied by this factor. If omitted, this is set to 1.0.

NOTES

If any of -cdl are specified, it is important that the raster category label and/or the site description are numeric. No error checking is done except for "no data" values as raster category labels. In this instance, a warning is issued and a zero value is assumed.

This program may not work properly with lat-long data when the -BC flags are used.

When interpolation is done (i.e., the -BC flags are used), values are assumed to be located at the centroid of grid cells. Therefore, current resolution settings are important.

SEE ALSO

s.rand
s.kcv
g.region
Image Sampling Methods - GRASS Tutorial on s.sample (available as s.sample-tutorial.ps.gz)

AUTHOR

James Darrell McCauley, Agricultural Engineering, Purdue University