NAME

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

SYNOPSIS

s.sample
s.sample help
s.sample [-BClq] input=name [attr=type] [field=value] [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). Category label values may 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.
-l
Use raster category label values instead of cell values. Labels must be numeric.
-q
Quiet. Cut out the chatter.

Parameters:

input=name
Name of sites list defining sample points.
attr=type
Site attribute type to use for comparison.
Options: none, dim, cat, decimal
If none is chosen no comparison will be done.
field=value
Site attribute field to use for comparison.
Ignored when the attribute is none or cat.
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

The output site list will have the easting and northing of the input site list. The category value will either be the same as the value in the input site list or a unique value if there were no categories in the input site list. One decimal attribute will be output containing either, the cell value of the raster if no comparison was done (i.e. attr=none) or it will be the difference between the cell value and the site list attribute value.

If -l is specified, it is important that the raster category label is 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.

When NULL values are encountered for a cell, zero value is used instead. In these cases, more acurrate results may be obtained by using the default nearest neighbor comparisons.

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.random
s.kcv
g.region
Image Sampling Methods - GRASS Tutorial on s.sample (available as s.sample-tutorial.ps.gz)

BUGS

Please send all bug fixes and comments to the author or the grass development team.
http://www.geog.uni-hannover/grass/

AUTHOR

James Darrell McCauley <darrell@mccauley-usa.com>,
when he was at: Agricultural Engineering Purdue University

Updated for GRASS 5.0 by Eric G. Miller

Last changed: $Date: 2002/01/25 05:45:35 $