v.class(1grass)
π v.class β the GRASS User's Manual page, but make it cute π
okay bestie, welcome to v.class(1grass), aka the vector classification girlie. she classifies attribute data, she's giving thematic mapping energy, and she's literally so good at it. let's get into it π
β¨ 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 [-b] map=name [layer=string] column=name [where=sql_query]
algorithm=string nbclasses=integer [separator=character] format=name
[--help] [--verbose] [--quiet] [--ui]
π Flags:
-bβ Print only class breaks (without min and max) β she's keeping it minimal, no cap β¨--helpβ Print usage summary--verboseβ Verbose module output--quietβ Quiet module output--uiβ Force launching GUI dialog (main character GUI moment π
π Parameters:
map=name[required] β Name of vector map. Or data source for direct OGR access.layer=stringβ Layer number or name. 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. Default:1column=name[required] β Column name or expression π«Άwhere=sql_queryβ WHERE conditions of SQL statement without 'where' keyword. Example:income < 1000 and population >= 10000algorithm=string[required] β Algorithm to use for classification. Options:int,std,qua,equ,disint: simple intervalsstd: standard deviationsqua: quantilesequ: equiprobable (normal distribution)dis: discontinuities
nbclasses=integer[required] β Number of classes to define. Options:2-separator=characterβ Field separator for printing output. Special characters: pipe, comma, space, tab, newline. Default:commaformat=name[required] β Output format. Options:plain,csv,json,list. Default:plainplain: Human readable text outputcsv: CSV (Comma Separated Values)json: JSON (JavaScript Object Notation)list: List of class breaks values
π DESCRIPTION π
So basically, v.class classifies vector attribute data into classes β think thematic mapping, bestie π. Classification can happen on a column OR on an expression that includes several columns, and all of that lives in the table linked to the vector map. You tell her how many classes you want and which algorithm to use, and she handles the rest.
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 iconic part: you can pipe class breaks into thematic mapping modules like d.vect.thematic (see the example below, it's giving collab π).
π NOTES π
okay so, algorithm by algorithm, let's vibe check them all π
- The equal interval algorithm simply divides the range
max-minby the number of breaks to determine the interval between class breaks. simple. clean. slay. - The quantiles algorithm creates classes which all contain approximately the same number of observations. balanced queen π
- 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 in order for all of the class breaks to 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. (so she warns you and adjusts, but lowkey the probabilities stay as originally asked π« )
- 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 recursive main character 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
0and1. 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. β οΈ (not her stopping, she keeps going, but she will let you know)
π₯ 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)
Latest change: Saturday Oct 11 04:38:40 2025 in commit: 3dd71f5fab83b72a2db2da959fe075c5b3b52200
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual
okay that's the whole page bestie, no skips, no summaries, every single detail preserved π this was GRASS 8.5.0, copyright Β© 2003-2026 GRASS Development Team, last touched Saturday Oct 11 04:38:40 2025 (commit 3dd71f5fab83b72a2db2da959fe075c5b3b52200) β periodt, go classify something iconic πππ
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· 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