db.univar(1grass)

πŸ’– db.univar β€” the GRASS User's Manual page, bestie edition πŸ’–

okay so. hi. you're here for db.univar, the GRASS GIS module, and honestly? she's that girl. sit down, grab a strawberry, let's get into it. πŸ“

KEYWORDS ✨ β€” database, statistics, attribute table. iykyk.


🌈 SYNOPSIS 🌈

db.univar
db.univar --help
db.univar [-eg] table=name column=name  [database=name]   [driver=name]
[where=sql_query]   [percentile=float[,float,...]]  format=name
[--help]  [--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags

  • -e β€” Extended statistics (quartiles and 90th percentile). not her being extra, we love that for her πŸ’…
  • -g β€” Print stats in shell script style [deprecated]. bestie. bestie listen. this flag is deprecated and it will be removed in a future release. use format=shell instead, fr fr. don't get attached. πŸ₯²
  • --help β€” Print usage summary
  • --verbose β€” Verbose module output
  • --quiet β€” Quiet module output
  • --ui β€” Force launching GUI dialog

🌸 Parameters

  • table=name [required] β€” Name of attribute table πŸ‘‘
  • column=name [required] β€” Name of attribute column on which to calculate statistics (must be numeric). no cap, she has to be numeric, she cannot be out here being text. πŸ”’
  • database=name β€” Name of database
  • driver=name β€” Name of database driver
    • Options: dbf, odbc, ogr, sqlite, pg
  • where=sql_query β€” WHERE conditions of SQL statement without 'where' keyword
    • Example: income < 1000 and population >= 10000
  • percentile=float[,float,...] β€” Percentile to calculate (requires extended statistics flag)
    • Options: 0-100
    • Default: 90
  • format=name [required] β€” Output format
    • Options: plain, json, shell
    • Default: plain
    • plain: Plain text output
    • json: JSON (JavaScript Object Notation)
    • shell: Shell script style for Bash eval

✨ DESCRIPTION ✨

so what does she actually do. db.univar calculates basic univariate statistics for numeric attributes in a data table. that's the whole vibe.

she will calculate minimum, maximum, range, mean, standard deviation, variance, coefficient of variation, quartiles, median, and the 90th percentile. obsessed. an absolute icon of a stat sheet. 😌

she does it by using db.select to create list values for statistical calculations. that's the technique. that's the move.

NOTES πŸ“ β€” If the database and driver are not specified, the default values set in db.connect will be used. so like, she's not gonna guess, she's gonna go with your saved defaults. periodt.

πŸ¦‹ EXAMPLE πŸ¦‹

In this example, random points are sampled from the elevation map (North Carolina sample dataset) and univariate statistics performed:

g.region raster=elevation -p
v.random output=samples n=100
v.db.addtable samples column="heights double precision"
v.what.rast samples raster=elevation column=heights
v.db.select samples
db.univar samples column=heights

look at that pipeline. the way she just flows. main character energy from start to finish. πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

v.db.univar, r.univar, v.univar, db.select, d.vect.thematic

(the squad. the besties. the whole friend group, honestly.)


πŸ’œ AUTHORS πŸ’œ

Michael Barton, Arizona State University

and authors of r.univar.sh


🌟 SOURCE CODE 🌟

Available at: db.univar source code (history)

Latest change: Saturday Feb 14 00:16:26 2026 in commit: ae1ae67e52b94c5cef185fac50aa33b38a56875f

Main index | Database index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


and that's the whole page, bestie!! πŸ’– go calculate some quartiles, drink water, and remember: default percentile is 90, format defaults to plain, and -g is deprecated so please let her rest. 🧚 this was the db.univar(1grass) man page from GRASS 8.5.0 β€” slay, bye!! πŸ’…πŸŒˆπŸ«Ά

πŸ“¦ where this page comes from