GRASS logo


v.vect.stats.multi - Computes isochrones from collection point in a sewershed


vector, attribute table, statistics, univariate statistics, zonal statistics, columns


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]


Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


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
Input feature type
Options: point, centroid
Default: point
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
Category values for points map
Example: 1,3,7-9,13
WHERE conditions of SQL statement without 'where' keyword for points map
Example: income < 1000 and population >= 10000
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
Category values for area map
Example: 1,3,7-9,13
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
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
Column names to upload statistics (generated by default)
By default, generated as source column name underscore method name

Table of contents


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.

Statistical methods

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:

The sum of values.
The average value of all point attributes (sum / count).
The value found half-way through a list of the attribute values, when these are ranged in numerical order.
The most frequently occurring value.
The minimum observed value.
The maximum observed value.
The range of the observed values.
The statistical standard deviation of the attribute values.
The statistical variance of the attribute values.
The number of different attribute values.
The count (number of points) is always computed and stored in count_column.

Column names

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.


ZIP codes and POIs

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 to see all the newly created columns: -c map=zipcodes_with_poi_stats
Use (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): 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

Specifying columns by name

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 Bash-like syntax):
v.vect.stats.multi points=firestations areas=zipcodes method=sum \
    count_column=count point_columns=PUMPERS,TANKER,AERIAL \



Vaclav Petras, NCSU Center for Geospatial Analytics


Available at: v.vect.stats.multi source code (history)

Latest change: Thursday Feb 03 09:32:35 2022 in commit: f17c792f5de56c64ecfbe63ec315307872cf9d5c

Main index | Vector index | Topics index | Keywords index | Graphical index | Full index

© 2003-2024 GRASS Development Team, GRASS GIS 8.3.3dev Reference Manual