Skip to content

v.clip

Extracts features of input map which overlay features of clip map.

v.clip [-dr] input=name clip=name output=name [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

v.clip input=name clip=name output=name

grass.script.run_command("v.clip", input, clip, output, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("v.clip", input="name", clip="name", output="name")

Parameters

input=name [required]
    Name of vector map to be clipped
    Or data source for direct OGR access
clip=name [required]
    Name of clip vector map
    Or data source for direct OGR access
output=name [required]
    Name for output vector map
-d
    Do not dissolve clip map
-r
    Clip by region
--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 vector map to be clipped
    Or data source for direct OGR access
    Used as: input, vector, name
clip : str, required
    Name of clip vector map
    Or data source for direct OGR access
    Used as: input, vector, name
output : str, required
    Name for output vector map
    Used as: output, vector, name
flags : str, optional
    Allowed values: d, r
    d
        Do not dissolve clip map
    r
        Clip by region
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.clip module enables extracting those features of input vector map, which overlay features of clip map, as well as their storing in a new vector map.

In default, boundaries of clip map are dissolved before clipping. Alternatively, flag -d can be ticked to retain the boundaries of clip map. Flag -b facilitates clipping by current computational region.

It is possible to clip vector maps consisting of points, lines, areas or combinations of these. However, the current version does not fully support clipping of mixed geometry containing points. In such a case, the output map will only store clipped lines and/or areas.

NOTES

v.clip is a front-end to v.overlay, as well as v.select. Clipping of areas and/or lines can be achieved using v.overlay. Clipping of points can be performed with v.select.

EXAMPLES

Basic use

Clip railroads by counties Wake and Johnston in North Carolina (North Carolina data set).

v.extract input=boundary_county where="NAME='WAKE' OR NAME='JOHNSTON'" output=county_WAKE_JOHNSTON
v.clip input=railroads clip=county_WAKE_JOHNSTON output=railroads_WAKE_JOHNSTON

v.clip example
Figure: v.clip example - basic use

Retain boundaries of clip map

v.clip -d input=railroads clip=county_WAKE_JOHNSTON output=railroads_WAKE_JOHNSTON

Clip by current computational region

Clip hospitals by computational region adjusted to counties Wake and Johnston in North Carolina (North Carolina data set). It is not obligatory to enter name of clip map. In case it is stated, the clip map will be omitted.

v.extract input=boundary_county where="NAME='WAKE' OR NAME='JOHNSTON'" output=county_WAKE_JOHNSTON
v.clip -r input=hospitals output=hospitals_clip

v.clip example
Figure: v.clip example - clip by computational region

SEE ALSO

v.overlay, v.select, v.dissolve, v.in.region

AUTHOR

Zofie Cimburova, GeoForAll Lab, Czech Technical University in Prague, Czech Republic

SOURCE CODE

Available at: v.clip source code (history)
Latest change: Wednesday Feb 12 23:02:46 2025 in commit 9c11460