GRASS logo

NAME

v.random.strat.sampling - sample data

KEYWORDS

vector, sampling, statistics, random, point pattern, stratified random sampling

SYNOPSIS

v.random.strat.sampling
v.random.strat.sampling --help
v.random.strat.sampling input=name [column=name] output=name npoints=integer [intcolumn=name] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

input=name [required]
Name of input vector map
Or data source for direct OGR access
column=name
Name of column with class information
output=name [required]
Name for output vector map
npoints=integer [required]
Number of points to be created for each class
Default: 100
intcolumn=name
Name of column to create new integer class information

Table of contents

DESCRIPTION

v.random.strat.sampling allows to sample training data in a stratified way. The number of points is the amount of vector sample points to be created for each class.

The module can deal with both numeric and text columns.

EXAMPLE

In this example we sample points from the North Carolina (USA) urban area map (from North Carolina sample dataset):
g.region vector=urbanarea -p

# show different attributes
v.db.select urbanarea_sampled_strat column=UA_TYPE -c | sort -u
UA
UC

# sample points randomly but stratified by the two classes from the vector areas
v.random.strat.sampling input=urbanarea column=UA_TYPE output=urbanarea_sampled_strat npoints=50

# new point map: show the attributes of the 50 UA  + 50 UC points
v.db.select urbanarea_sampled_strat

v.info -t urbanarea_sampled_strat
nodes=0
points=100
lines=0
boundaries=0
centroids=0
areas=0
islands=0
primitives=100
map3d=0
v.random.strat.sampling example
Figure: 50 sample points per class (stratified sampling on NC urban area map)

SEE ALSO

v.random, r.sample.category (Addon)

AUTHORS

Hajar Benelcadi and Anika Bettge (main development), mundialis, Germany

SOURCE CODE

Available at: v.random.strat.sampling source code (history)

Accessed: Tuesday Apr 16 17:44:27 2024


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

© 2003-2024 GRASS Development Team, GRASS GIS 8.4.0dev Reference Manual