r.stats.quantile(1grass)
π r.stats.quantile π
okay bestie, welcome to r.stats.quantile(1grass) β the tool that does quantile math on your rasters and honestly? it ate. β¨
πΈ NAME πΈ
r.stats.quantile β compute category quantiles using two passes. yes, two. it's giving thorough. π
π KEYWORDS π
raster, statistics, zonal statistics, percentile, quantile
π¦ SYNOPSIS π¦
r.stats.quantile
r.stats.quantile --help
r.stats.quantile [-rpt] base=name cover=name [quantiles=integer]
[percentiles=float[,float,...]] [bins=integer]
[output=name[,name,...]] [file=name] [separator=character]
format=name [--overwrite] [--help] [--verbose] [--quiet] [--ui]
β¨ Flags β¨
-rβ create a reclass map where the statistics show up as category labels. labels, bestie, we love a labeled moment π·οΈ-pβ don't make any output maps, just print the statistics. lowkey the chill option π«Ά-tβ print statistics in table format. deprecated, babes. this flag is deprecated and will be removed in a future release. useformat=csvinstead. periodt, the table flag is on its way out π--overwriteβ allow output files to overwrite existing files. be careful, it's giving no-takebacks energy π--helpβ print usage summary--verboseβ verbose module output--quietβ quiet module output π€«--uiβ force launching GUI dialog
π Parameters π
base=name[required] β name of base raster mapcover=name[required] β name of cover raster mapquantiles=integerβ number of quantilespercentiles=float[,float,...]β list of percentiles. Default:50bins=integerβ number of bins to use. Default:1000output=name[,name,...]β resultant raster map(s)file=nameβ name for output file (if omitted or"-"output to stdout)separator=characterβ field separator. special characters:pipe,comma,space,tab,newlineformat=name[required] β output format. Options:plain,csv,json. Default:plainplain: human readable text outputcsv: CSV (Comma Separated Values)json: JSON (JavaScript Object Notation)
π DESCRIPTION π
so r.stats.quantile is the tool that analyses exploratory statistics of a floating-point "cover layer" based on how it intersects with objects in a "base layer". it hands you quantile calculations β you know, the ones selected as "zonal statistics". main character energy fr fr π
β NOTES β
r.stats.quantile is intended as a partial replacement for r.statistics, and the big glow-up is that it supports floating-point cover maps. it provides quantile calculations β which are straight-up absent from r.stats.zonal. so if you needed quantiles and zonal wasn't giving, this is your girl. π
quantiles are calculated following algorithm 7 from Hyndman and Fan (1996), which is also the default in R and numpy. iykyk, algorithm 7 is iconic. β¨
π§ EXAMPLE π§
in this example, the raster polygon map zipcodes in the North Carolina sample dataset is used to calculate quantile raster statistics using the elevation raster map:
g.region raster=zipcodes -p
# print quantiles
r.stats.quantile base=zipcodes cover=elevation quantiles=3 -p
27511:0:33.333333:134.717392
27511:1:66.666667:143.985723
27513:0:33.333333:140.669993
27513:1:66.666667:146.279449
27518:0:33.333333:115.140101
27518:1:66.666667:129.893723
[...]
# write out percentile raster maps
r.stats.quantile base=zipcodes cover=elevation percentiles=25,50,75 \
output=zipcodes_elev_q25,zipcodes_elev_q50,zipcodes_elev_q75
look at those numbers go π so satisfying.
π REFERENCES π
- Hyndman and Fan (1996) Sample Quantiles in Statistical Packages, American Statistician. American Statistical Association. 50 (4): 361-365. DOI: 10.2307/2684934
- Engineering Statistics Handbook: Percentile, NIST
π SEE ALSO π
r.quantile, r.stats.zonal, r.statistics
π«Ά AUTHORS π«Ά
Glynn Clements Markus Metz
π» SOURCE CODE π»
available at: r.stats.quantile source code (history)
latest change: Saturday Oct 11 04:38:40 2025 in commit: 3dd71f5fab83b72a2db2da959fe075c5b3b52200
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole page, bestie, you're officially quantile-pilled πΈ
and before you go β the manual is GRASS 8.5.0, and it's Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual. mwah, go compute some quantiles πβ¨π
π¦ 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