v.neighbors1grass
Neighborhood analysis tool for vector point maps. makes each cell value a function of the attribute values assigned to the vector points or centroids in a radius around it, and stores new cell values in an output raster map.
Usage
v.neighbors
v.neighbors --help
v.neighbors input=name
[layer=string]
output=name
method=string
size=float
[points_column=name]
[cats=range]
[where=sql_query]
[--overwrite]
[--help]
[--verbose]
[--quiet]
[--ui]
Keywords
vector, algebra, statistics, raster, aggregation
Overview
This module makes each cell value a function of the attribute values assigned to the vector points or centroids in an area around the cell with a diameter of size around it, and stores the new cell values in the output raster map layer. By default, the module just counts the number of points. The user can also choose amongst a variety of aggregate statistics using the parameter method. These statistics are calculated on the attributes in the point_column. Using the usual cats and where parameters the user can chose to take only a subset of the points into account.
Note that size is defined as the diameter, and so has to be twice the wanted search radius, and that the module works within the current computational region which can be adjusted using g.region. If the vector map falls completely outside the current region, the module will stop with an error.
Examples
Count the number of schools for a given grid (North Carolina sample dataset):
g.region vector=schools_wake res=100 -p -av.neighbors input=schools_wake output=schools_wake_3000m method=count size=3000d.mon wx0d.rast schools_wake_3000md.vect schools_wake
The result gives for each grid cell the number of points (here: schools) not farther than 1500 meter away (half of the given size value) from the respective cell center.
Calculate the mean capacity of schools for the same grid:
v.neighbors input=schools_wake output=schools_capacity point_column=CAPACITYTO \method=average size=3000
Source code
Available at: v.neighbors source code (history)
Accessed: Monday Feb 24 17:51:17 2025
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
Releases
10 releases since Debian 4.0 (Etch); the text changed 9 times.