v.type
Changes type of vector features.
v.type input=name [layer=string] output=name from_type=string to_type=string [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
v.type input=name output=name from_type=line to_type=boundary
grass.script.run_command("v.type", input, layer="-1", output, from_type="line", to_type="boundary", overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("v.type", input="name", output="name", from_type="line", to_type="boundary")
Parameters
input=name [required]
Name of input vector map
Or data source for direct OGR access
layer=string
Layer number or name ('-1' for all layers)
A single vector map can be connected to multiple database tables. This number determines which table to use. When used with direct OGR access this is the layer name.
Default: -1
output=name [required]
Name for output vector map
from_type=string [required]
Feature type to convert from
Allowed values: point, line, boundary, centroid, face, kernel
Default: line
to_type=string [required]
Feature type to convert to
Allowed values: point, line, boundary, centroid, face, kernel
Default: boundary
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
input : str, required
Name of input vector map
Or data source for direct OGR access
Used as: input, vector, name
layer : str, optional
Layer number or name ('-1' for all layers)
A single vector map can be connected to multiple database tables. This number determines which table to use. When used with direct OGR access this is the layer name.
Used as: input, layer
Default: -1
output : str, required
Name for output vector map
Used as: output, vector, name
from_type : str, required
Feature type to convert from
Allowed values: point, line, boundary, centroid, face, kernel
Default: line
to_type : str, required
Feature type to convert to
Allowed values: point, line, boundary, centroid, face, kernel
Default: boundary
overwrite: bool, optional
Allow output files to overwrite existing files
Default: False
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
v.type changes the type of geometry primitives.
The following vector object types are defined in GRASS GIS:
- point: a point;
- line: a directed sequence of connected vertices with two endpoints called nodes;
- boundary: the border line describing an area;
- centroid: a point within a closed ring of boundaries;
- area: the topological composition of a closed ring of boundaries and a centroid;
- face: a 3D area;
- kernel: a 3D centroid in a volume (not yet implemented);
- volume: a 3D corpus, the topological composition of faces and kernel (not yet implemented).
Lines and boundaries can be composed of multiple vertices.
Area topology also holds information about isles. These isles are located within that area, not touching the boundaries of the outer area. Isles are holes inside the area, and can consist of one or more areas. They are used internally to maintain correct topology for areas.
EXAMPLES
Convert lines to area boundaries
v.type input=map_l output=map_b from_type=line to_type=boundary
In order to create areas, centroids must be added with v.centroids.
SEE ALSO
AUTHOR
Radim Blazek, ITC-Irst, Trento, Italy
SOURCE CODE
Available at: v.type source code
(history)
Latest change: Friday Feb 07 19:16:09 2025 in commit a82a39f