Note: A new GRASS GIS stable version has been released: GRASS GIS 7. Go directly to the new manual page here
NAME
v.random - Randomly generate a 2D/3D vector points map.
KEYWORDS
vector, statistics
SYNOPSIS
v.random
v.random help
v.random [-zdb] output=name n=integer [zmin=float] [zmax=float] [column=string] [--overwrite] [--verbose] [--quiet]
Flags:
- -z
- Create 3D output
- -d
- Use drand48() function instead of rand()
- -b
- Do not build topology
- --overwrite
- Allow output files to overwrite existing files
- --verbose
- Verbose module output
- --quiet
- Quiet module output
Parameters:
- output=name
- Name for output vector map
- n=integer
- Number of points to be created
- zmin=float
- Minimum z height (needs -z flag or column name)
- Default: 0.0
- zmax=float
- Maximum z height (needs -z flag or column name)
- Default: 0.0
- column=string
- Column name and type (i.e. INTEGER, DOUBLE PRECISION) for z values
- If type is not given then DOUBLE PRECISION is used. Writes Z data to column instead of 3D vector.
DESCRIPTION
v.random randomly generates vector points within the
current region using the selected random number generator.
v.random can generate also 3D vector points or
write random value to attribute table. Point height range or
attribute value range is controlled by specifying zmin and zmax values.
Both z values are included in range (zmin >= z <= zmax).
Generated random attribute value type can be controlled by column
data type. Use INTEGER column type for integers and
DOUBLE PRECISION for floating point numbers. Integer values are
calculated by rounding random floating point number.
EXAMPLES
Generate 20 random points with binary attribute (only 0 or 1):
v.random output=binary_random n=20 zmin=0 zmax=1 column='binary INTEGER'
Get 20 random samples from raster map:
v.random output=random_samples n=20
v.db.addtable map=random_samples layer=1 columns='cat INTEGER, sample DOUBLE PRECISION'
v.what.rast vector=random_samples raster=elevation.10m@PERMANENT layer=1 column=sample
Generate 20 random points and sample attribute data from geology (vector) map:
v.random output=random_samples n=20
v.db.addtable map=random_samples layer=1 columns='cat integer, geology varchar(100)'
v.what.vect vector=random_samples layer=1 column=geology qvector=geology@PERMANENT qlayer=1 qcolumn=label
SEE ALSO
UNIX man pages for rand(3) and drand48(3).
g.region,
r.random,
v.perturb,
v.sample
v.what.rast
v.what.vect
BUGS
The RNG used by
v.perturb
should probably be added to this program.
AUTHOR
James Darrell McCauley
<darrell@mccauley-usa.com>,
when he was at:
Agricultural
Engineering
Purdue University
Last changed: $Date: 2011-11-08 03:29:50 -0800 (Tue, 08 Nov 2011) $
Main index - vector index - Full index
© 2003-2016 GRASS Development Team