db.univar(1)

πŸ’– db.univar β€” the GRASS GIS manual, bestie edition πŸ’–

okay so welcome to db.univar(1), straight out of the GRASS GIS User's Manual. sit down, grab a strawberry πŸ“, and let's get you stats-pilled.


✨ NAME ✨

db.univar β€” calculates univariate statistics on selected table column. that's it, that's the whole gig. πŸ‘‘


🏷️ 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=string]
[--help]  [--verbose]  [--quiet]  [--ui]

look at her. main character syntax. no cap.


πŸŽ€ Flags πŸŽ€

  • -e β€” extended statistics, meaning quartiles and the 90th percentile. going the extra mile, as she should. ✨
  • -g β€” print stats in shell script style. for when you want your output to be friends with Bash.
  • --help β€” print usage summary. the classic "help me bestie" move.
  • --verbose β€” verbose module output. she's chatty and we love that for her.
  • --quiet β€” quiet module output. shhh. 🀫
  • --ui β€” force launching GUI dialog. buttons instead of typing, no judgement.

🌸 Parameters 🌸

  • table=name [required] β€” name of attribute table. mandatory, periodt.
  • column=name [required] β€” name of attribute column on which to calculate statistics. it must be numeric, like actually, don't try it with text, it's not gonna eat. πŸ’€
  • 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 the 'where' keyword. Example: income < 1000 and population >= 10000
  • percentile=float[,float,...] β€” percentile to calculate (requires the extended statistics flag, so like, don't forget -e). Options: 0-100 Default: 90
  • format=string β€” output format. Options: plain, json, shell
    • plain: Plain text output
    • json: JSON (JavaScript Object Notation)
    • shell: Shell script style for Bash eval

πŸ’œ DESCRIPTION πŸ’œ

db.univar calculates basic univariate statistics for numeric attributes in a data table. the way it just does that. πŸ’…

it will calculate minimum, maximum, range, mean, standard deviation, variance, coefficient of variation, quartiles, median, and 90th percentile. that's a whole roster of numbers and every single one of them is showing up. πŸ”₯

it uses db.select to create list values for statistical calculations. iconic teamwork.

NOTES 🫢 β€” if the database and driver are not specified, the default values set in db.connect will be used. so like, she already knows where to go.

πŸ¦‹ 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

the whole pipeline. ate and left no crumbs. ✨


πŸ‘€ SEE ALSO πŸ‘€

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

go read those too, bestie, they're all in the group chat. 🫢


πŸ‘‘ AUTHORS πŸ‘‘

Michael Barton, Arizona State University

and authors of r.univar.sh

shoutout to the legends. πŸ†


πŸ’Ύ SOURCE CODE πŸ’Ύ

Available at: db.univar source code (history)

Accessed: Saturday Jan 17 05:41:52 2026

Main index | Database 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 GRASS 8.4.2, and yes she's still db.univar(1) in the footer, forever and always. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from