GRASS logo

NAME

v.rast.move - Move vertices by distance specified in a raster

KEYWORDS

vector, transformation, geometry, raster, lines

SYNOPSIS

v.rast.move
v.rast.move --help
v.rast.move input=name x_raster=name y_raster=name [nulls=string] output=name [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

--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
x_raster=name [required]
Name of input raster map
y_raster=name [required]
Name of input raster map
nulls=string
Handling of null values
zeros;Null value will be converted to zeros;warning;A null value will cause a warning (one for each raster) and will be converted to zero;error;A null value will cause an error
Options: zeros, warning, error
Default: warning
output=name [required]
Name for output vector map

Table of contents

DESCRIPTION

v.rast.move takes values from raster maps and adds them to X and Y coordinates of features in a vector map vertex by vertex. Works on lines only, other features are ignored and not included in the result. Null values in rasters are turned into zeros by default and a warning is generated. This behavior can be modified by the nulls option to either silence the warning with explicit nulls="zeros" or the warning can be turned into an error with nulls="error". The rasters are loaded based on the computational region, so the most advantageous use of resources is to set the computational region to match the vector. To avoid issues with vector coordinates at the border of the computational region, it is best to also grow the region one cell on each side. Vector features outside of the computational region always result in an error being reported (regardless of the nulls option), but the rasters can have any extent as along as the computational region is set to match the vector.

NOTES

Unlike v.perturb which moves points randomly, v.rast.move works on vertices of lines and uses same value for all vertices at a given cell. Unlike v.transform used with raster values in attribute columns, v.rast.move operates on individual vertices in the line, not on the whole line (attributes are associated with features, not their vertices).

EXAMPLES

Shift in X direction

This example uses the North Carolina sample dataset. Set the computational region to match the vector map and use 100-meter resolution.
g.region vector=roadsmajor res=100
Generate rasters for a shift in X direction (one raster is a wave, the other is zero):
g.region vector=roadsmajor res=100
r.mapcalc expression="a = 1000 * sin(row())"
r.mapcalc expression="b = 0"
Use the rasters to move the vector:
v.rast.move input=roadsmajor output=roads_moved x_raster=a y_raster=b
Two roads networks
Figure: Original (blue) and shifted (red) road network and the X shift values in diverging blue-white-red colors (red shift right, blue shift left, white no shift)

SEE ALSO

AUTHOR

Vaclav Petras, NCSU Center for Geospatial Analytics, GeoForAll Lab

SOURCE CODE

Available at: v.rast.move source code (history)

Latest change: Monday Nov 11 18:04:48 2024 in commit: 59e289fdb093de6dd98d5827973e41128196887d


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

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