.TH v.transform 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBv.transform\fR\fR - Performs an affine transformation (shift, scale and rotate, or GPCs) on vector map. .SH KEYWORDS vector, transformation .SH SYNOPSIS \fBv.transform\fR .br \fBv.transform help\fR .br \fBv.transform\fR [\-\fBqtwms\fR] \fBinput\fR=\fIname\fR [\fBlayer\fR=\fIinteger\fR] \fBoutput\fR=\fIname\fR [\fBpointsfile\fR=\fIname\fR] [\fBxshift\fR=\fIfloat\fR] [\fByshift\fR=\fIfloat\fR] [\fBzshift\fR=\fIfloat\fR] [\fBxscale\fR=\fIfloat\fR] [\fByscale\fR=\fIfloat\fR] [\fBzscale\fR=\fIfloat\fR] [\fBzrot\fR=\fIfloat\fR] [\fBtable\fR=\fIname\fR] [\fBcolumns\fR=\fIstring\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-q\fR" 4m .br Suppress display of residuals or other information .IP "\fB\-t\fR" 4m .br Shift all z values to bottom=0 .IP "\fB\-w\fR" 4m .br Swap coordinates x, y and then apply other parameters .IP "\fB\-m\fR" 4m .br Print the transformation matrix to stdout .IP "\fB\-s\fR" 4m .br Instead of points use transformation parameters (xshift, yshift, zshift, xscale, yscale, zscale, zrot) .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of input vector map .IP "\fBlayer\fR=\fIinteger\fR" 4m .br Layer number .br A single vector map can be connected to multiple database tables. This number determines which table to use. .br Default: \fI-1\fR .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output vector map .IP "\fBpointsfile\fR=\fIname\fR" 4m .br ASCII file holding transform coordinates .br If not given, transformation parameters (xshift, yshift, zshift, xscale, yscale, zscale, zrot) are used instead .IP "\fBxshift\fR=\fIfloat\fR" 4m .br Shifting value for x coordinates .br Default: \fI0.0\fR .IP "\fByshift\fR=\fIfloat\fR" 4m .br Shifting value for y coordinates .br Default: \fI0.0\fR .IP "\fBzshift\fR=\fIfloat\fR" 4m .br Shifting value for z coordinates .br Default: \fI0.0\fR .IP "\fBxscale\fR=\fIfloat\fR" 4m .br Scaling factor for x coordinates .br Default: \fI1.0\fR .IP "\fByscale\fR=\fIfloat\fR" 4m .br Scaling factor for y coordinates .br Default: \fI1.0\fR .IP "\fBzscale\fR=\fIfloat\fR" 4m .br Scaling factor for z coordinates .br Default: \fI1.0\fR .IP "\fBzrot\fR=\fIfloat\fR" 4m .br Rotation around z axis in degrees counterclockwise .br Default: \fI0.0\fR .IP "\fBtable\fR=\fIname\fR" 4m .br Name of table containing transformation parameters .IP "\fBcolumns\fR=\fIstring\fR" 4m .br Name of attribute column(s) used as transformation parameters .br Format: parameter:column, e.g. xshift:xs,yshift:ys,zrot:zr .PP .SH DESCRIPTION \fIv.transform\fR 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. .SH NOTES When using an ASCII table containing source and target coordinate pairs, in each row four coordinate values separated by white space have to be specified. Comments are permitted and have to be indicated by a '#' character. .PP Example for a points file of a linear transformation from XY to UTM coordinates (L: left, R: right, U: upper, L: lower, N, S, W, E): \fC .DS .br # Linear transformation from XY to UTM coordinates: .br # 4 maps corners defined .br # UL NW .br # UR NE .br # LR SW .br # LL SE .br -584 585 598000 4920770 .br 580 585 598020 4920770 .br 580 -600 598020 4920750 .br -584 -600 598000 4920750 .br .DE \fR .PP The ground control points may be also (ir)regularly distributed and can be more than four points. .PP Transformation parameters (i.e. \fIxshift\fR, \fIyshift\fR, 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. .PP .SS Affine Transformation Matrix The affine transfomation matrix can optionally be printed with the '-m' flag. The format of the matrix is: \fC .DS .br | x_offset a b | .br | y_offset d e | .br .DE \fR This format can be used in the Affine() function of PostGIS [Affine(geom, a, b, d, e, xoff, yoff)], or directly compared to the output of a similar operation performed in R. .SH EXAMPLE .SS DXF/DWG drawings .PP Most DXF/DWG drawings are done within XY coordinate space. To transform them to a national grid, we can use 'v.transform' with a 4 point transformation. \fC .DS .br v.transform \-t in=watertowerXY out=watertowerUTM points=wt.points zscale=0.04 zshift=1320 .br .DE \fR .SS Extrude 2D vector points to 3D based on attribute column values Spearfish example with manual table editing for vertical shift: \fC .DS .br # create table containing transformation parameters: .br echo "create table archsites_t (cat int, zs double)" | db.execute .br # insert transformation parameters for category 1: .br echo "insert into archsites_t values (1, 1000)" | db.execute .br # insert transformation parameters for category 2 (and so forth): .br echo "insert into archsites_t values (2, 2000)" | db.execute .br .br # perform z transformation: .br v.transform \-t input=archsites output=myarchsites3d column="zshift:zs" table="archsites_t" .br # drop table containing transformation parameters: .br echo "drop table archsites_t" | db.execute .br .DE \fR The resulting map is a 3D vector map. .SS Extrude 2D vector points to 3D based on attribute column values Spearfish example with automated elevation extraction for vertical shift: \fC .DS .br # work on own map copy: .br g.copy vect=archsites@PERMANENT,myarchsites .br # add new 'zs' column to later store height of each site: .br v.db.addcol myarchsites col="zs double precision" .br .br # set region to elevation map and fetch individual heights: .br g.region rast=elevation.10m \-p .br v.what.rast myarchsites rast=elevation.10m col=zs .br # verify: .br v.db.select myarchsites .br .br # perform transformation to 3D .br v.transform \-t myarchsites output=myarchsites3d column="zshift:zs" table=myarchsites .br # drop table containing transformation parameters .br v.db.dropcol myarchsites3d col=zs .br .DE \fR The resulting map is a 3D vector map. .SH SEE ALSO \fIv.in.ogr\fR .SH AUTHOR Radim Blazek, ITC-irst, Trento, Italy, .br Column support added by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy (2007/09) .PP \fILast changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team