Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
NAME
v.vect.stats.multi  Computes isochrones from collection point in a sewershed
KEYWORDS
vector,
attribute table,
statistics,
univariate statistics,
zonal statistics,
columns
SYNOPSIS
v.vect.stats.multi
v.vect.stats.multi help
v.vect.stats.multi points=name areas=name [type=string[,string,...]] [points_layer=string] [points_cats=range] [points_where=sql_query] [areas_layer=string] [areas_cats=range] [areas_where=sql_query] method=string[,string,...] [points_columns=name[,name,...]] count_column=name [stats_columns=name] [help] [verbose] [quiet] [ui]
Flags:
 help
 Print usage summary
 verbose
 Verbose module output
 quiet
 Quiet module output
 ui
 Force launching GUI dialog
Parameters:
 points=name [required]
 Name of existing vector map with points
 Vector map with one or more attributes
 areas=name [required]
 Name of existing vector map with points
 Vector map with one or more attributes
 type=string[,string,...]
 Input feature type
 Options: point, centroid
 Default: point
 points_layer=string
 Layer number for points map
 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: 1
 points_cats=range
 Category values for points map
 Example: 1,3,79,13
 points_where=sql_query
 WHERE conditions of SQL statement without 'where' keyword for points map
 Example: income < 1000 and population >= 10000
 areas_layer=string
 Layer number for area map
 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: 1
 areas_cats=range
 Category values for area map
 Example: 1,3,79,13
 areas_where=sql_query
 WHERE conditions of SQL statement without 'where' keyword for area map
 Example: income < 1000 and population >= 10000
 method=string[,string,...] [required]
 Method for aggregate statistics
 Options: sum, average, median, mode, minimum, maximum, range, stddev, variance, diversity
 points_columns=name[,name,...]
 Column names of points map to compute statistics from
 Defaults to all numeric columns. The specified columns must be numeric
 count_column=name [required]
 Column name to upload points count
 Column to hold points count, must be of type integer, will be created if not existing
 stats_columns=name
 Column names to upload statistics (generated by default)
 By default, generated as source column name underscore method name
v.vect.stats.multi computes attribute statistics of points in vector map
points falling into each area in vector map
areas.
The results are uploaded to the attribute table of the vector map
areas.
By default, statistics are computed for all integer and floating point attributes (columns),
e.g., DOUBLE PRECISION and INTEGER columns will be used, but TEXT will not.
Specific (multiple) columns can be selected using points_columns.
The type of the selected columns again need to be some integer and floating point type.
Using numeric attribute values of all points falling into a given area,
a new value is determined with the selected method.
v.vect.stats can perform the following operations:
 sum
 The sum of values.
 average
 The average value of all point attributes (sum / count).
 median
 The value found halfway through a list of the
attribute values, when these are ranged in numerical order.
 mode
 The most frequently occurring value.
 minimum
 The minimum observed value.
 maximum
 The maximum observed value.
 range
 The range of the observed values.
 stddev
 The statistical standard deviation of the attribute values.
 variance
 The statistical variance of the attribute values.
 diversity
 The number of different attribute values.
The count (number of points) is always computed and stored in
count_column.
The
stats_columns can be used to provide custom column names
instead of the generated ones.
If provided, the number of columns must be number of
points_columns
times number of methods requested (in
method).
The order of names is that first come all statistics for one column,
then all statistics for another column, etc.
If only one statistical method is requested, then it is simply
one column from
points_columns after another.
Note that the number of names
stats_columns is checked against
the number of columns that will be created. However, whether the names correspond
to what is being computed for the columns cannot be checked, so, for example,
providing names for one statistic for all columns, followed by another statistic,
etc. will result in a mismatch between column names and what was actually computed.
This module is using
v.vect.stats
underneath to do the actual statistical computations.
See v.vect.stats for details about behavior in special cases.
The following example is using points of interest (POIs) and ZIP code
areas vector from the basic North Carolina sample database:
Create a copy of ZIP code areas in the current mapset
to allow for adding attributes (using a name which expresses
what you will add later on):
g.copy vector=zipcodes@PERMANENT,zipcodes_with_poi_stats
Compute minimum and maximum for each numerical colum in the attribute table
of points of interest:
v.vect.stats.multi points=points_of_interest areas=zipcodes_with_poi_stats method=minimum,maximum count_column=point_count
Use
v.info to see all the newly created columns:
v.info c map=zipcodes_with_poi_stats
Use
v.db.select (or GUI) to examine the values
(you can see subset of the data by selecting only specific columns
or using the where cause to get only certain rows):
v.db.select map=zipcodes_with_poi_stats
Each of the new columns separately can be assigned color using
v.colors:
v.colors map=zipcodes_with_poi_stats use=attr column=elev_m_maximum color=viridis rgb_column=elev_m_maximum_color
Assuming a similar setup as in the previous example
(
g.copy used to create a copy in the current mapset),
you can ask for statistics only on columns PUMPERS, TANKER, and AERIAL
and specify the names of new columns using:
(wrapping a long line here using Bashlike syntax):
v.vect.stats.multi points=firestations areas=zipcodes method=sum \
count_column=count point_columns=PUMPERS,TANKER,AERIAL \
stats_columns=all_pumpers,all_tankers,all_aerials

v.vect.stats
for printing information instead of storing it in
the attribute table,

v.what.rast.multi
for querying multiple raster maps by one vector points map,

g.copy
for creating a copy of vector map to update
(to preserve the original data given that this module performs
a large automated operation).
Vaclav Petras,
NCSU Center for Geospatial Analytics
SOURCE CODE
Available at:
v.vect.stats.multi source code
(history)
Latest change: Mon Jun 28 07:54:09 2021 in commit: 1cfc0af029a35a5d6c7dae5ca7204d0eb85dbc55
Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
Main index 
Vector index 
Topics index 
Keywords index 
Graphical index 
Full index
© 20032023
GRASS Development Team,
GRASS GIS 7.8.8dev Reference Manual