Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages
v.transform(1) Grass User's Manual v.transform(1)

v.transform - Performs an affine transformation (shift, scale and rotate) on vector map.

vector, transformation, geometry, GCP

v.transform --help
v.transform [-twxyab] input=name [layer=string] output=name [xshift=float] [ yshift=float] [zshift=float] [ xscale=float] [yscale=float] [ zscale=float] [zrotation=float] [columns=name[,name,...]] [-- overwrite] [--help] [--verbose] [--quiet] [--ui]

Shift all z values to bottom=0
Swap coordinates x, y and then apply other parameters
Swap coordinates x, z and then apply other parameters
Swap coordinates y, z and then apply other parameters
Swap coordinates after the other transformations
Do not build topology
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
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
Shifting value for x coordinates
Default: 0.0
Shifting value for y coordinates
Default: 0.0
Shifting value for z coordinates
Default: 0.0
Scaling factor for x coordinates
Default: 1.0
Scaling factor for y coordinates
Default: 1.0
Scaling factor for z coordinates
Default: 1.0
Rotation around z axis in degrees (counter-clockwise)
Default: 0.0
Name of attribute column(s) used as transformation parameters
Format: parameter:column, e.g. xshift:xs,yshift:ys,zrot:zr

v.transform performs an affine transformation (translate and rotate) of a vector map. An affine transform includes one or several linear transformations (scaling, rotation) and translation (shifting). Several linear transformations can be combined in a single operation. The command can be used to georeference unreferenced vector maps or to modify existing geocoded maps.

Coordinate transformation based on Ground Control Points (GCPs) is done by v.rectify and not supported by v.transform.
Transformation parameters (i.e. xshift, yshift, etc.) can be fetched from attribute table connected to the vector map. In this case vector objects can be transformed with different parameters based on their category number. If the parameter cannot be fetched from the table, default value is used instead.
Note that the transformation matrix can be printed by m.transform.

Most DXF/DWG drawings are done within XY coordinate space. To transform them to a national grid, we can use v.transform together with v.rectify and a first-order transformation.
v.transform -t in=watertowerXY out=watertower_z zscale=0.04 zshift=1320
v.rectify in=watertower_z out=watertowerUTM points=wt.points order=1

Spearfish example with manual table editing for vertical shift:
# work on own map copy:
g.copy vect=archsites@PERMANENT,myarchsites
# add new ’zs’ column to later store height of each site:
v.db.addcolumn myarchsites col="zs double precision"
v.db.update myarchsites layer=1 column=zs value="cat * 1000"
# perform z transformation:
v.transform -t input=archsites output=myarchsites3d column="zshift:zs" table="archsites_t"
# drop table containing transformation parameters:
echo "drop table archsites_t" | db.execute
The resulting map is a 3D vector map.

Spearfish example with automated elevation extraction for vertical shift:
# work on own map copy:
g.copy vect=archsites@PERMANENT,myarchsites
# add new ’zs’ column to later store height of each site:
v.db.addcolumn myarchsites col="zs double precision"
# set region to elevation map and fetch individual heights:
g.region raster=elevation.10m -p
v.what.rast myarchsites rast=elevation.10m col=zs
# verify: myarchsites
# perform transformation to 3D
v.transform -t myarchsites output=myarchsites3d column="zshift:zs" layer=1
# drop table containing transformation parameters
v.db.dropcolumn myarchsites3d col=zs
The resulting map is a 3D vector map.

m.transform, i.rectify, v.rectify, r.region

Radim Blazek, ITC-irst, Trento, Italy,
Column support added by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy (2007/09)
Last changed: $Date: 2015-08-07 05:24:55 +0200 (Fri, 07 Aug 2015) $

Available at: v.transform source code (history)
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2018 GRASS Development Team, GRASS GIS 7.4.3 Reference Manual
GRASS 7.4.3

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.