v.transform(1)

πŸ’– v.transform(1) β€” the GRASS GIS User's Manual glow-up ✨

okay bestie, this is v.transform(1) from the GRASS GIS User's Manual and it is literally the affine transformation queen. sit down, grab a strawberry πŸ“, and let's go.


🌸 NAME 🌸

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


πŸŽ€ KEYWORDS πŸŽ€

vector, transformation, geometry, GCP


✨ SYNOPSIS ✨

v.transform
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]

πŸ’… Flags πŸ’…

  • -t β€” Shift all z values to bottom=0
  • -w β€” Swap coordinates x, y and then apply other parameters
  • -x β€” Swap coordinates x, z and then apply other parameters
  • -y β€” Swap coordinates y, z and then apply other parameters
  • -a β€” Swap coordinates after the other transformations
  • -b β€” Do not build topology
  • --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
  • layer=string β€” 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
  • xshift=float β€” Shifting value for x coordinates. Default: 0.0
  • yshift=float β€” Shifting value for y coordinates. Default: 0.0
  • zshift=float β€” Shifting value for z coordinates. Default: 0.0
  • xscale=float β€” Scaling factor for x coordinates. Default: 1.0
  • yscale=float β€” Scaling factor for y coordinates. Default: 1.0
  • zscale=float β€” Scaling factor for z coordinates. Default: 1.0
  • zrotation=float β€” Rotation around z axis in degrees (counter-clockwise). Default: 0.0
  • columns=name[,name,...] β€” Name of attribute column(s) used as transformation parameters. Format: parameter:column, e.g. xshift:xs,yshift:ys,zrot:zr

πŸ‘‘ DESCRIPTION πŸ‘‘

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.

fr fr that's the whole plot πŸ’–


🌈 NOTES 🌈

Coordinate transformation based on Ground Control Points (GCPs) is done by v.rectify and not supported by v.transform. so don't come for this one, that's a different girl's job 😌

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.

ngl, this is the part that's giving main character energy: per-object transformation. every category can get its own little glow-up πŸ’…

Note that the transformation matrix can be printed by m.transform.


πŸ”₯ EXAMPLE πŸ”₯

🧚 DXF/DWG drawings 🧚

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

πŸ“ Extrude 2D vector points to 3D based on attribute column values πŸ“

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

🌸 Extrude 2D vector points to 3D based on attribute column values 🌸

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:
v.db.select 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. ✨


πŸ’œ SEE ALSO πŸ’œ

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


🫢 AUTHORS 🫢

Radim Blazek, ITC-irst, Trento, Italy, Column support added by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy (2007/09)


⭐ SOURCE CODE ⭐

Available at: v.transform source code (history)

Accessed: Saturday Jan 17 05:41:31 2026

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

Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual


and that's the whole page bestie πŸ’–βœ¨ go transform something iconic, this was GRASS 8.4.2 and the manual got accessed on Saturday Jan 17 05:41:31 2026 β€” Β© 2003-2025 GRASS Development Team, slay πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from