GRASS logo

NAME

v.neighborhoodmatrix - Exports the neighborhood matrix of polygons in a vector map

KEYWORDS

vector, neighborhood matrix

SYNOPSIS

v.neighborhoodmatrix
v.neighborhoodmatrix --help
v.neighborhoodmatrix [-b] input=name [player=integer] [idcolumn=name] [output=name] [separator=character] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-b
create bidirectional matrix (same neighborhood relation repeated twice)
--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:

input=name [required]
Name of input vector map
Or data source for direct OGR access
player=integer
Layer in map where polygons are to be found
Default: 1
idcolumn=name
Name of column containing polygon ids
output=name
Name for output file (if omitted or "-" output to stdout)
separator=character
Field separator
Special characters: pipe, comma, space, tab, newline
Default: pipe

Table of contents

DESCRIPTION

v.neighborhoodmatrix identifies all adjacency relations between polygons in a vector map and exports these as a 2xn matrix where n is the number of neighborhood relations with each relation only listed in one direction (i.e. if a is neighbor of b, the list will contain a,b, but not b,a) unless the b flag is specified. By default, neighbors are identified by the category numbers. Using the idcolumn parameter the user can define a column to use as identifier of the polygons. If a path to an output file is specified, the matrix will be written to that file, otherwise it will be sent to standard output.

NOTES

Currently the module assumes that the layer above the layer containing the polygons is empty and available for adding categories to boundaries. The module uses v.to.db to determine neighborhood relations.

EXAMPLE

Send the neighborhood matrix of the census tracts of the North Carolina dataset to standard output identifying each tract by its category value:
v.neighborhoodmatrix in=census_wake2000
Idem, but identifying each tract by its STFID code and sending the output to a file:
v.neighborhoodmatrix in=census_wake2000 idcolumn=STFID output=census_neighbors.csv

SEE ALSO

v.to.db

AUTHOR

Moritz Lennert

SOURCE CODE

Available at: v.neighborhoodmatrix source code (history)

Latest change: Monday Jan 30 19:52:26 2023 in commit: cac8d9d848299297977d1315b7e90cc3f7698730


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

© 2003-2023 GRASS Development Team, GRASS GIS 8.3.dev Reference Manual