3
<EM>v.random</EM> randomly generates vector points within the
4
current region using the selected random number generator.
6
<p><em>v.random</em> can generate also 3D vector points or
7
write random value to attribute table. Point height range or
8
attribute value range is controlled by specifying zmin and zmax values.
9
Both z values are included in range (<em>zmin >= z <= zmax</em>).
10
Generated random attribute value type can be controlled by column
11
data type. Use <b>INTEGER</b> column type for integers and
12
<b>DOUBLE PRECISION</b> for floating point numbers. Integer values are
13
calculated by rounding random floating point number.
16
Generate 20 random points with binary attribute (only 0 or 1):
17
<div class="code"><pre>
18
v.random output=binary_random n=20 zmin=0 zmax=1 column='binary INTEGER'
21
Get 20 random samples from raster map:
22
<div class="code"><pre>
23
v.random output=random_samples n=20
24
v.db.addtable map=random_samples layer=1 columns='cat INTEGER, sample DOUBLE PRECISION'
25
v.what.rast vector=random_samples raster=elevation.10m@PERMANENT layer=1 column=sample
28
Generate 20 random points and sample attribute data from geology (vector) map:
29
<div class="code"><pre>
30
v.random output=random_samples n=20
31
v.db.addtable map=random_samples layer=1 columns='cat integer, geology varchar(100)'
32
v.what.vect vector=random_samples layer=1 column=geology qvector=geology@PERMANENT qlayer=1 qcolumn=label
37
UNIX man pages for <EM>rand(3)</EM> and <EM>drand48(3)</EM>.
40
<A HREF="g.region.html">g.region</a>,
41
<A HREF="r.random.html">r.random</a>,
42
<A HREF="v.perturb.html">v.perturb</A>,
43
<A HREF="v.sample.html">v.sample</A>
44
<a href="v.what.rast.html">v.what.rast</a>
45
<a href="v.what.vect.html">v.what.vect</a>
51
<EM><A HREF="v.perturb.html">v.perturb</A></EM>
52
should probably be added to this program.<BR>
56
<A HREF="http://mccauley-usa.com/">James Darrell McCauley</A>
57
<A HREF="mailto:darrell@mccauley-usa.com"><darrell@mccauley-usa.com></A>,
59
<A HREF="http://ABE.www.ecn.purdue.edu/ABE/">Agricultural
61
<A HREF="http://www.purdue.edu/">Purdue University</A>
63
<p><i>Last changed: $Date: 2008-08-03 20:28:11 +0200 (Sun, 03 Aug 2008) $</i>