.TH v.class 1grass "" "GRASS 8.4.1" "GRASS GIS User's Manual"
.SH NAME
\fI\fBv.class\fR\fR  \- Classifies attribute data, e.g. for thematic mapping
.SH KEYWORDS
vector, classification, attribute table, statistics
.SH SYNOPSIS
\fBv.class\fR
.br
\fBv.class \-\-help\fR
.br
\fBv.class\fR [\-\fBg\fR] \fBmap\fR=\fIname\fR  [\fBlayer\fR=\fIstring\fR]  \fBcolumn\fR=\fIname\fR  [\fBwhere\fR=\fIsql_query\fR]  \fBalgorithm\fR=\fIstring\fR \fBnbclasses\fR=\fIinteger\fR  [\-\-\fBhelp\fR]  [\-\-\fBverbose\fR]  [\-\-\fBquiet\fR]  [\-\-\fBui\fR]
.SS Flags:
.IP "\fB\-g\fR" 4m
.br
Print only class breaks (without min and max)
.IP "\fB\-\-help\fR" 4m
.br
Print usage summary
.IP "\fB\-\-verbose\fR" 4m
.br
Verbose module output
.IP "\fB\-\-quiet\fR" 4m
.br
Quiet module output
.IP "\fB\-\-ui\fR" 4m
.br
Force launching GUI dialog
.SS Parameters:
.IP "\fBmap\fR=\fIname\fR \fB[required]\fR" 4m
.br
Name of vector map
.br
Or data source for direct OGR access
.IP "\fBlayer\fR=\fIstring\fR" 4m
.br
Layer number or name
.br
Vector features can have category values in different layers. This number determines which layer to use. When used with direct OGR access this is the layer name.
.br
Default: \fI1\fR
.IP "\fBcolumn\fR=\fIname\fR \fB[required]\fR" 4m
.br
Column name or expression
.IP "\fBwhere\fR=\fIsql_query\fR" 4m
.br
WHERE conditions of SQL statement without \(cqwhere\(cq keyword
.br
Example: income < 1000 and population >= 10000
.IP "\fBalgorithm\fR=\fIstring\fR \fB[required]\fR" 4m
.br
Algorithm to use for classification
.br
Options: \fIint, std, qua, equ, dis\fR
.br
\fBint\fR: simple intervals
.br
\fBstd\fR: standard deviations
.br
\fBqua\fR: quantiles
.br
\fBequ\fR: equiprobable (normal distribution)
.IP "\fBnbclasses\fR=\fIinteger\fR \fB[required]\fR" 4m
.br
Number of classes to define
.SH DESCRIPTION
\fIv.class\fR classifies vector attribute data into classes, for
example for thematic mapping. Classification can be on a column or on an
expression including several columns, all in the table linked to the
vector map. The user indicates the number of classes desired and the
algorithm to use for classification.
Several algorithms are implemented for classification: equal interval,
standard deviation, quantiles, equal probabilities, and a discontinuities
algorithm developed by Jean\-Pierre Grimmeau at the Free University of
Brussels (ULB).
It can be used to pipe class breaks into thematic mapping modules such
as \fId.vect.thematic\fR (see example below);
.SH NOTES
.PP
The \fIequal interval\fR algorithm simply divides the range max\-min
by the number of breaks to determine the interval between class breaks.
.PP
The \fIquantiles\fR algorithm creates classes which all contain
approximately the same number of observations.
.PP
The \fIstandard deviations\fR algorithm creates class breaks which
are a combination of the mean +/\- the standard deviation. It calculates
a scale factor (<1) by which to multiply the standard deviation in
order for all of the class breaks to fall into the range min\-max of the
data values.
.PP
The \fIequiprobabilites\fR algorithm creates classes that would be
equiprobable if the distribution was normal. If some of the class breaks
fall outside the range min\-max of the data values, the algorithm prints
a warning and reduces the number of breaks, but the probabilities used
are those of the number of breaks asked for.
.PP
The \fIdiscont\fR algorithm systematically searches discontinuities
in the slope of the cumulative frequencies curve, by approximating this
curve through straight line segments whose vertices define the class
breaks. The first approximation is a straight line which links the two
end nodes of the curve. This line is then replaced by a two\-segmented
polyline whose central node is the point on the curve which is farthest
from the preceding straight line. The point on the curve furthest from
this new polyline is then chosen as a new node to create break up one of
the two preceding segments, and so forth.
.PP
The problem of the difference in terms of units between the two axes
is solved by rescaling both amplitudes to an interval between 0 and 1.
In the original algorithm, the process is stopped when the difference between
the slopes of the two new segments is no longer significant (alpha = 0.05). As
the slope is the ratio between the frequency and the amplitude of the corresponding
interval, i.e. its density, this effectively tests whether the frequencies
of the two newly proposed classes are different from those obtained by
simply distributing the sum of their frequencies amongst them in proportion
to the class amplitudes. In the GRASS implementation, the algorithm
continues, but a warning is printed.
.SH EXAMPLE
Classify column pop of map communes into 5 classes using quantiles:
.br
.nf
\fC
v.class map=communes column=pop algo=qua nbclasses=5
\fR
.fi
This example uses population and area to calculate a population density
and to determine the density classes:
.br
.nf
\fC
v.class map=communes column=pop/area algo=std nbclasses=5
\fR
.fi
The following example uses the output of d.class and feeds it directly
into \fId.vect.thematic\fR:
.br
.nf
\fC
d.vect.thematic \-l map=communes2 column=pop/area \(rs
    breaks=\(gav.class \-g map=communes2 column=pop/area algo=std nbcla=5\(ga \(rs
    colors=0:0:255,50:100:255,255:100:50,255:0:0,156:0:0
\fR
.fi
.SH SEE ALSO
\fI
v.univar,
d.vect.thematic
\fR
.SH AUTHOR
Moritz Lennert
.SH SOURCE CODE
.PP
Available at:
v.class source code
(history)
.PP
Accessed: Monday Feb 24 17:51:10 2025
.PP
Main index |
Vector index |
Topics index |
Keywords index |
Graphical index |
Full index
.PP
© 2003\-2025
GRASS Development Team,
GRASS GIS 8.4.1 Reference Manual
