v.rectify(1grass)

✨ v.rectify ✨

okay bestie, gather round, because this is the v.rectify page from the GRASS User's Manual and it's genuinely iconic πŸ’…


🌸 NAME 🌸

v.rectify β€” it rectifies a vector by computing a coordinate transformation for each object in the vector, based on the control points. that's the whole vibe.


πŸŽ€ KEYWORDS πŸŽ€

vector, rectify, level1, geometry


πŸ¦‹ SYNOPSIS πŸ¦‹

v.rectify
v.rectify --help
v.rectify [-3orb] input=name output=name  [group=name]   [points=name]
[rmsfile=name]   [order=integer]   [separator=character]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

πŸ’– Flags πŸ’–

  • -3 β€” Perform 3D transformation. three dee, we're going there 🧚
  • -o β€” Perform orthogonal 3D transformation.
  • -r β€” Print RMS errors. literally just print RMS errors and exit without rectifying the input map. no notes, just errors ✨
  • -b β€” Do not build topology. Advantageous when handling a large number of points. lowkey a lifesaver when there's a LOT going on.
  • --overwrite β€” Allow output files to overwrite existing files. careful bestie, it will absolutely do it πŸ”₯
  • --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.
  • output=name [required] β€” Name for output vector map.
  • group=name β€” Name of input imagery group.
  • points=name β€” Name of input file with control points.
  • rmsfile=name β€” Name of output file with RMS errors (if omitted or '-' output to stdout.
  • order=integer β€” Rectification polynomial order (1-3). Options: 1-3. Default: 1.
  • separator=character β€” Field separator for RMS report. Special characters: pipe, comma, space, tab, newline. Default: pipe.

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea, bestie: v.rectify uses control points to calculate a 2D or 3D transformation matrix based on a first, second, or third order polynomial, and then it converts x,y(, z) coordinates to standard map coordinates for each object in the vector map. the result is a vector map with a transformed coordinate system β€” meaning a different coordinate system than before it was rectified. glow up, frankly. πŸ’…

the -o flag enforces orthogonal rotation (currently for 3D only) where the axes remain orthogonal to each other β€” like, a cube with right angles stays a cube with right angles after transformation. and ngl, that is not guaranteed even with affine (1st order) 3D transformation. so keep that in mind.

⚠️ Great care should be taken with the placement of Ground Control Points. this part is not a joke. - For 2D transformation, the control points must not lie on a line β€” instead 3 of the control points must form a triangle. - For 3D transformation, the control points must not lie on a plane β€” instead 4 of the control points must form a triangular pyramid.

it is recommended to investigate RMS errors and deviations of the Ground Control Points prior to transformation. do the vibe check first, fr fr. 🫢

2D Ground Control Points can be identified in g.gui.gcp. iconic.

3D Ground Control Points must be provided in a text file with the points option. The 3D format is equivalent to the format for 2D ground control points with an additional third coordinate:

x y z east north height status

where x, y, z are source coordinates, east, north, height are target coordinates, and status (0 or 1) indicates whether a given point should be used. Numbers must be separated by space and must use a point (.) as decimal separator. absolutely no commas as decimals, don't do it πŸ™ˆ

If no group is given, the rectified vector will be written to the current mapset. If a group is given and a target has been set for this group with i.target, the rectified vector will be written to the target project and mapset. ✨

🌈 Coordinate transformation and RMSE 🌈

The desired order of transformation (1, 2, or 3) is selected with the order option. If the -r flag is given, v.rectify will calculate the Root Mean Square Error (RMSE) and print out statistics in tabular format. The last row gives a summary with the first column holding the number of active points, followed by average deviations for each dimension and both forward and backward transformation and finally forward and backward overall RMSE. cute little table, very demure. πŸŽ€

πŸ’œ 2D linear affine transformation (1st order transformation) πŸ’œ

x' = a1 + b1 * x + c1 * y
y' = a2 + b2 * x + c2 * y

πŸ’œ 3D linear affine transformation (1st order transformation) πŸ’œ

x' = a1 + b1 * x + c1 * y + d1 * z
y' = a2 + b2 * x + c2 * y + d2 * z
z' = a3 + b3 * x + c3 * y + d3 * z

The a,b,c,d coefficients are determined by least squares regression based on the control points entered. This transformation applies scaling, translation and rotation. It is NOT a general purpose rubber-sheeting, nor is it ortho-photo rectification using a DEM, not second order polynomial, etc. It can be used if (1) you have geometrically correct data, and (2) the terrain or camera distortion effect can be ignored. periodt. πŸ’…

πŸ’œ Polynomial Transformation Matrix (2nd, 3d order transformation) πŸ’œ

v.rectify uses a first, second, or third order transformation matrix to calculate the registration coefficients. The minimum number of control points required for a 2D transformation of the selected order (represented by n) is

((n + 1) * (n + 2) / 2)

or 3, 6, and 10 respectively. For a 3D transformation of first, second, or third order, the minimum number of required control points is 4, 10, and 20, respectively. It is strongly recommended that more than the minimum number of points be identified to allow for an overly-determined transformation calculation which will generate the Root Mean Square (RMS) error values for each included point. The polynomial equations are determined using a modified Gaussian elimination method. math girlies, this one's for you 🧚


⭐ SEE ALSO ⭐

The GRASS 4 Image Processing manual

g.gui.gcp, i.group, i.rectify, i.target, m.transform, r.proj, v.proj, v.transform

Manage Ground Control Points


🌸 AUTHOR 🌸

Markus Metz

based on i.rectify


πŸ’– SOURCE CODE πŸ’–

Available at: v.rectify source code (history)

Latest change: Friday Apr 17 01:04:26 2026 in commit: 32a143358df26b2e518b03c7e0d79541e8d1e5b1

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

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


and that's the whole page bestie, no cap β€” this was GRASS 8.5.0, v.rectify(1grass) from the GRASS User's Manual, last touched Friday Apr 17 01:04:26 2026, Β© 2003-2026 GRASS Development Team. go forth and rectify something iconic πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from