GRASS logo


v.kernel - Generates a raster density map from vector points map.
Density is computed using a moving kernel. Optionally generates a vector density map on a vector network.


vector, kernel density, point density, heatmap, hotspot


v.kernel --help
v.kernel [-oqnm] input=name [net=name] [output=name] [net_output=name] radius=float [dsize=float] [segmax=float] [distmax=float] [multiplier=float] [node=string] [kernel=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Try to calculate an optimal radius with given 'radius' taken as maximum (experimental)
Only calculate optimal radius and exit (no map is written)
In network mode, normalize values by sum of density multiplied by length of each segment. Integral over the output map then gives 1.0 * multiplier
In network mode, multiply the result by number of input points
Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


input=name [required]
Name of input vector map with training points
Name of input network vector map
Name for output raster map
Name for output vector density map
Outputs vector map if network map is given
radius=float [required]
Kernel radius in map units
Discretization error in map units
Default: 0.
Maximum length of segment on network
Default: 100.
Maximum distance from point to network
Default: 100.
Multiply the density result by this number
Default: 1.
Node method
Options: none, split
Default: none
none: No method applied at nodes with more than 2 arcs
split: Equal split (Okabe 2009) applied at nodes
Kernel function
Options: uniform, triangular, epanechnikov, quartic, triweight, gaussian, cosine
Default: gaussian

Table of contents


v.kernel generates a raster density map from vector points data using a moving kernel. Available kernel density functions are uniform, triangular, epanechnikov, quartic, triweight, gaussian, cosine, default is gaussian.

The module can also generate a vector density map on a vector network. Conventional kernel functions produce biased estimates by overestimating the densities around network nodes, whereas the equal split method of Okabe et al. (2009) produces unbiased density estimates. The equal split method uses the kernel function selected with the kernel option and can be enabled with node=split.


The multiplier option is needed to overcome the limitation that the resulting density in case of a vector map output is stored as category (integer). The density result stored as category may be multiplied by this number.

For the gaussian kernel, standard deviation for the gaussian function is set to 1/4 of the radius.

With the -o flag (experimental) the command tries to calculate an optimal radius. The value of radius is taken as maximum value. The radius is calculated based on the gaussian function, using ALL points, not just those in the current region.


Compute density of points (using vector map of schools from North Carolina sample dataset):
g.region region=wake_30m
v.kernel input=schools_wake output=schools_density radius=5000 multiplier=1000000
r.colors map=schools_density color=bcyr
Density of schools
School density


The module only considers the presence of points, but not (yet) any attribute values.



Overview: Interpolation and Resampling in GRASS GIS


Stefano Menegon, ITC-irst, Trento, Italy
Radim Blazek (additional kernel density functions and network part)


Available at: v.kernel source code (history)

Latest change: Sunday Feb 12 15:51:56 2023 in commit: 7d6ff54e985c1579e11b74c230cb8fa68a9aa928

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

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