v.class(1)
β¨ v.class β the manual page, but make it make sense β¨
okay bestie, welcome to v.class(1) from the GRASS GIS User's Manual π this is the one that classifies attribute data, like, for thematic mapping. no cap.
π NAME π
v.class β classifies attribute data, e.g. for thematic mapping π
π·οΈ KEYWORDS π·οΈ
vector, classification, attribute table, statistics π
π SYNOPSIS π
v.class
v.class --help
v.class [-g] map=name [layer=string] column=name [where=sql_query]
algorithm=string nbclasses=integer [--help] [--verbose] [--quiet]
[--ui]
π© Flags π©
-gβ only prints the class breaks, no min, no max. just the breaks, periodt.--helpβ prints the usage summary π«Ά--verboseβ verbose module output, she's chatty--quietβ quiet module output, she's giving mystery--uiβ forces the GUI dialog to launch β¨
π§© Parameters π§©
map=name[required] β the name of the vector map. or, if you're doing direct OGR access, the data source πΈlayer=stringβ layer number or name. vector features can have category values in different layers, and this number decides which layer we're on. when you use direct OGR access, this is the layer name instead. Default:1column=name[required] β column name or expression πwhere=sql_queryβ WHERE conditions of an SQL statement, without the'where'keyword. Example:income < 1000 and population >= 10000algorithm=string[required] β the algorithm to use for classification. Options:int,std,qua,equ,disint: simple intervalsstd: standard deviationsqua: quantilesequ: equiprobable (normal distribution)
nbclasses=integer[required] β how many classes you want to define π’
π DESCRIPTION π
v.class classifies vector attribute data into classes β for thematic mapping, for example. the classification can happen on a column, or on an expression that includes several columns, all in the table linked to the vector map. you tell it how many classes you want and which algorithm to use, and it does the thing β¨
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) π
and here's the fun part, bestie: it can be used to pipe class breaks into thematic mapping modules such as d.vect.thematic β there's an example down below π
π§ NOTES π§
The equal interval algorithm just divides the range max-min by the number of breaks to figure out the interval between class breaks. simple. clean. iconic.
The quantiles algorithm creates classes which all contain approximately the same number of observations.
The standard deviations 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 so that all of the class breaks fall into the range min-max of the data values.
The equiprobabilites 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. okay so it tells you, it just doesn't fully obey π
The discont 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. it's giving recursion energy fr fr π₯
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. π
π EXAMPLE π
Classify column pop of map communes into 5 classes using quantiles:
v.class map=communes column=pop algo=qua nbclasses=5
This example uses population and area to calculate a population density and to determine the density classes:
v.class map=communes column=pop/area algo=std nbclasses=5
The following example uses the output of d.class and feeds it directly into d.vect.thematic:
d.vect.thematic -l map=communes2 column=pop/area \
breaks=`v.class -g map=communes2 column=pop/area algo=std nbcla=5` \
colors=0:0:255,50:100:255,255:100:50,255:0:0,156:0:0
π¦ SEE ALSO π¦
v.univar, d.vect.thematic
π AUTHOR π
Moritz Lennert π
π₯ SOURCE CODE π₯
Available at: v.class source code (history)
Accessed: Saturday Jan 17 05:41:18 2026
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
and that's the whole page bestie π
this was v.class(1) from the GRASS 8.4.2 Reference Manual, accessed Saturday Jan 17 05:41:18 2026, and you absolutely ate it π«Ά no notes, slay, go classify something β¨πΈπ
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms