EnglishFrenchSpanish

OnWorks favicon

r.univargrass - Online in the Cloud

Run r.univargrass in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command r.univargrass that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


r.univar - Calculates univariate statistics from the non-null cells of a raster map.
Statistics include number of cells counted, minimum and maximum cell values, range,
arithmetic mean, population variance, standard deviation, coefficient of variation, and
sum.

KEYWORDS


raster, statistics, univariate statistics, zonal statistics

SYNOPSIS


r.univar
r.univar --help
r.univar [-get] map=name[,name,...] [zones=name] [output=name]
[percentile=float[,float,...]] [separator=character] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]

Flags:
-g
Print the stats in shell script style

-e
Calculate extended statistics

-t
Table output format instead of standard output format

--overwrite
Allow output files to overwrite existing files

--help
Print usage summary

--verbose
Verbose module output

--quiet
Quiet module output

--ui
Force launching GUI dialog

Parameters:
map=name[,name,...] [required]
Name of raster map(s)

zones=name
Raster map used for zoning, must be of type CELL

output=name
Name for output file (if omitted or "-" output to stdout)

percentile=float[,float,...]
Percentile to calculate (requires extended statistics flag)
Options: 0-100
Default: 90

separator=character
Field separator
Special characters: pipe, comma, space, tab, newline
Default: pipe

DESCRIPTION


r.univar calculates the univariate statistics of one or several raster map(s). This
includes the number of cells counted, minimum and maximum cell values, range, arithmetic
mean, population variance, standard deviation, coefficient of variation, and sum.
Statistics are calculated separately for every category/zone found in the zones input map
if given. If the -e extended statistics flag is given the 1st quartile, median, 3rd
quartile, and given percentile are calculated. If the -g flag is given the results are
presented in a format suitable for use in a shell script. If the -t flag is given the
results are presented in tabular format with the given field separator. The table can
immediately be converted to a vector attribute table which can then be linked to a vector,
e.g. the vector that was rasterized to create the zones input raster.

When multiple input maps are given to r.univar, the overall statistics are calculated.
This is useful for a time series of the same variable, as well as for the case of a
segmented/tiled dataset. Allowing multiple raster maps to be specified saves the user from
using a temporary raster map for the result of r.series or r.patch.

NOTES


As with most GRASS raster modules, r.univar operates on the raster array defined by the
current region settings, not the original extent and resolution of the input map. See
g.region.

This module can use large amounts of system memory when the -e extended statistics flag is
used with a very large region setting. If the region is too large the module should exit
gracefully with a memory allocation error. Basic statistics can be calculated using any
size input region.

Without a zones input raster, the r.quantile module will be significantly more efficient
for calculating percentiles with large maps.

For calculating univariate statistics from a raster map based on vector polygon map and
uploads statistics to new attribute columns, see v.rast.stats.

EXAMPLE


In this example, the raster polygon map basins in the North Carolina sample dataset is
used to calculate raster statistics for zones for elevation raster map:
g.region raster=basins -p
This will set and print computational region in the format:
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 10
ewres: 10
rows: 1350
cols: 1500
cells: 2025000
Check basin’s IDs using:
r.category basins
This will print them in the format:
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
Visualization of them underlying elevation map can be created as:
d.mon wx0
d.rast map=elevation
r.colors map=elevation color=grey
d.rast map=basins
r.colors map=basins color=bgyr
d.legend raster=basins use=2,4,6,8,10,12,14,16,18,20,22,24,26,28,30
d.barscale

Figure: Zones (basins, opacity: 60%) with underlying elevation map for North Carolina
sample dataset.

Then statistics for elevation can be calculated separately for every zone, i.e. basin
found in the zones parameter:
r.univar -t map=elevation zones=basins separator=comma \
output=basin_elev_zonal.csv
This will print information in the format:
zone,label,non_null_cells,null_cells,min,max,range,mean,mean_of_abs,
stddev,variance,coeff_var,sum,sum_abs2,,116975,0,55.5787925720215,
133.147018432617,77.5682258605957,92.1196971445722,92.1196971445722,
15.1475301152556,229.447668592576,16.4433129773355,10775701.5734863,
10775701.57348634,,75480,0,61.7890930175781,110.348838806152,
48.5597457885742,83.7808205765268,83.7808205765268,11.6451777476995,
135.610164775515,13.8995747088232,6323776.33711624,6323776.33711624
6,,1137,0,66.9641571044922,83.2070922851562,16.2429351806641,
73.1900814395257,73.1900814395257,4.15733292896409,17.2834170822492,
5.68018623179036,83217.1225967407,83217.12259674078,,80506,
0,67.4670791625977,147.161514282227, ...
Comma Separated Values (CSV) file is best viewed through a spreadsheet program such as
Microsoft Excel, Libre/Open Office Calc or Google Docs:

Figure: Raster statistics for zones (basins, North Carolina sample dataset) viewed through
Libre/Open Office Calc

TODO


To be implemented mode, skewness, kurtosis.

Use r.univargrass online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 2
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • 3
    SuiteCRM
    SuiteCRM
    SuiteCRM is the award-winning Customer
    Relationship Management (CRM)
    application brought to you by authors
    and maintainers, SalesAgility. It is the
    world�s mos...
    Download SuiteCRM
  • 4
    Poweradmin
    Poweradmin
    Poweradmin is a web-based DNS
    administration tool for PowerDNS server.
    The interface has full support for most
    of the features of PowerDNS. It has full
    support...
    Download Poweradmin
  • 5
    Gin Web Framework
    Gin Web Framework
    Gin is an incredibly fast web framework
    written in Golang that can perform up to
    40 times faster, thanks to its
    martini-like API and custom version of
    httprout...
    Download Gin Web Framework
  • 6
    CEREUS LINUX
    CEREUS LINUX
    CEREUS LINUX basado en MX LINUX con
    varios entornos de escritorios. This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/cereu...
    Download CEREUS LINUX
  • More »

Linux commands

  • 1
    aa-clickquery
    aa-clickquery
    aa-clickquery - program for querying
    click-apparmor DESCRIPTION: This program
    is used to query click-apparmor for
    information. USAGE: aa-clickquery
    --click-fra...
    Run aa-clickquery
  • 2
    aa-exec-click
    aa-exec-click
    aa-exec-click - program for executing
    click packages under confinement
    DESCRIPTION: This program is used to
    execute click package under AppArmor
    confinement. I...
    Run aa-exec-click
  • 3
    cpio
    cpio
    cpio - copy files to and from archives ...
    Run cpio
  • 4
    cpipe
    cpipe
    cpipe - copy stdin to stdout while
    counting bytes and reporting progress ...
    Run cpipe
  • 5
    FvwmSave
    FvwmSave
    FvwmSave - the Fvwm desktop-layout
    saving module ...
    Run FvwmSave
  • 6
    FvwmSave1
    FvwmSave1
    FvwmSave - the FVWM desktop-layout
    saving module ...
    Run FvwmSave1
  • More »

Ad