GRASS logo


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


vector, transformation, geometry, raster, lines


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


Allow output files to overwrite existing files
Print usage summary
Verbose module output
Quiet module output
Force launching GUI dialog


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
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


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.


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).


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)



Vaclav Petras, NCSU Center for Geospatial Analytics, GeoForAll Lab


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

Latest change: Saturday Jun 22 14:53:35 2024 in commit: 97909c7bd95000561e4bc08f36b1bd738b445b6f

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

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