v.sample(1grass)

v.sample1grass

Samples a raster map at vector point locations.

Usage

v.sample

v.sample --help

v.sample input=name [layer=string] column=name output=name raster=name [method=string] [zscale=float] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Keywords

vector, sampling, raster

Overview

v.sample samples a GRASS raster map at the point locations in the input file by either cubic convolution interpolation, bilinear interpolation, or nearest neighbor sampling (default).

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

Notes

The output points will have the easting and northing of the input points. The input category value is used. The input attribute, raster value and difference is written to output.

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.

Examples

Comparison of "elev_ned_30m" and "elev_srtm_30m" North Carolina sample dataset elevation models at random positions:

# set computational region:
 g.region raster=elev_srtm_30m -p
# generate random points:
 v.random output=random n=100
# add table with one column:
 v.db.addtable random col="elev_srtm30 double precision"
# transfer elevations at random points into table:
 v.what.rast map=random rast=elev_srtm_30m col=elev_srtm30
# verify:
 v.db.select random
# perform sampling on other elevation map:
 v.sample in=random col=elev_srtm30 rast=elev_ned_30m out=elev_samples
#verify:
 v.db.select elev_samples
#univariate statistics of differences between elevation maps:
 v.univar elev_samples column=diff type=point

Source code

Available at: v.sample source code (history)

Accessed: Monday Feb 24 17:51:23 2025

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual

Releases

10 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13

Authors

James Darrell McCauley
when he was at: Agricultural Engineering Purdue University

Updated for GRASS 5.0 by Eric G. Miller
Updated for GRASS 5.7 by Radim Blazek

From grass-doc 8.4.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.