1v.sample(1) GRASS GIS User's Manual v.sample(1)
2
3
4
6 v.sample - Samples a raster map at vector point locations.
7
9 vector, sampling, raster
10
12 v.sample
13 v.sample --help
14 v.sample input=name [layer=string] column=name output=name
15 raster=name [method=string] [zscale=float] [--overwrite] [--help]
16 [--verbose] [--quiet] [--ui]
17
18 Flags:
19 --overwrite
20 Allow output files to overwrite existing files
21
22 --help
23 Print usage summary
24
25 --verbose
26 Verbose module output
27
28 --quiet
29 Quiet module output
30
31 --ui
32 Force launching GUI dialog
33
34 Parameters:
35 input=name [required]
36 Name of input vector point map
37 Or data source for direct OGR access
38
39 layer=string
40 Layer number or name
41 Vector features can have category values in different layers. This
42 number determines which layer to use. When used with direct OGR
43 access this is the layer name.
44 Default: 1
45
46 column=name [required]
47 Name of attribute column to use for comparison
48
49 output=name [required]
50 Name for output vector map to store differences
51
52 raster=name [required]
53 Name of raster map to be sampled
54
55 method=string
56 Sampling interpolation method
57 Options: nearest, bilinear, bicubic
58 Default: nearest
59 nearest: Nearest-neighbor interpolation
60 bilinear: Bilinear interpolation
61 bicubic: Bicubic interpolation
62
63 zscale=float
64 Scaling factor for values read from raster map
65 Sampled values will be multiplied by this factor
66 Default: 1.0
67
69 v.sample samples a GRASS raster map at the point locations in the input
70 file by either cubic convolution interpolation, bilinear interpolation,
71 or nearest neighbor sampling (default).
72
73 This program may be especially useful when sampling for cross valida‐
74 tion of interpolations whose output is a raster map.
75
77 The output points will have the easting and northing of the input
78 points. The input category value is used. The input attribute, raster
79 value and difference is written to output.
80
81 When NULL values are encountered for a cell, zero value is used
82 instead. In these cases, more acurrate results may be obtained by
83 using the default nearest neighbor comparisons.
84
85 This program may not work properly with lat-long data when the -bc
86 flags are used.
87
88 When interpolation is done (i.e., the -bc flags are used), values are
89 assumed to be located at the centroid of grid cells. Therefore, cur‐
90 rent resolution settings are important.
91
93 Comparison of "elev_ned_30m" and "elev_srtm_30m" North Carolina sample
94 dataset elevation models at random positions:
95 # set computational region:
96 g.region raster=elev_srtm_30m -p
97 # generate random points:
98 v.random output=random n=100
99 # add table with one column:
100 v.db.addtable random col="elev_srtm30 double precision"
101 # transfer elevations at random points into table:
102 v.what.rast map=random rast=elev_srtm_30m col=elev_srtm30
103 # verify:
104 v.db.select random
105 # perform sampling on other elevation map:
106 v.sample in=random col=elev_srtm30 rast=elev_ned_30m out=elev_samples
107 #verify:
108 v.db.select elev_samples
109 #univariate statistics of differences between elevation maps:
110 v.univar elev_samples column=diff type=point
111
113 g.region, v.random, v.what.rast Image Sampling Methods - GRASS Tuto‐
114 rial on s.sample (available as s.sample-tutorial.ps.gz)
115
117 James Darrell McCauley
118 when he was at: Agricultural Engineering Purdue University
119
120 Updated for GRASS 5.0 by Eric G. Miller
121 Updated for GRASS 5.7 by Radim Blazek
122
124 Available at: v.sample source code (history)
125
126 Main index | Vector index | Topics index | Keywords index | Graphical
127 index | Full index
128
129 © 2003-2020 GRASS Development Team, GRASS GIS 7.8.5 Reference Manual
130
131
132
133GRASS 7.8.5 v.sample(1)