m.transform
Computes a coordinate transformation based on the control points.
m.transform [-srx] group=name order=integer [format=string [,string,...]] [input=name] [--verbose] [--quiet] [--qq] [--ui]
Example:
m.transform group=name order=1
grass.script.run_command("m.transform", group, order=1, format="fd,rd", input=None, flags=None, verbose=None, quiet=None, superquiet=None)
Example:
gs.run_command("m.transform", group="name", order=1)
grass.tools.Tools.m_transform(group, order=1, format="fd,rd", input=None, flags=None, verbose=None, quiet=None, superquiet=None)
Example:
tools = Tools()
tools.m_transform(group="name", order=1)
This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.
Parameters
group=name [required]
Name of input imagery group
order=integer [required]
Rectification polynomial order
Allowed values: 1-3
Default: 1
format=string [,string,...]
Output format
Allowed values: idx, src, dst, fwd, rev, fxy, rxy, fd, rd
Default: fd,rd
idx: point index
src: source coordinates
dst: destination coordinates
fwd: forward coordinates (destination)
rev: reverse coordinates (source)
fxy: forward coordinates difference (destination)
rxy: reverse coordinates difference (source)
fd: forward error (destination)
rd: reverse error (source)
input=name
File containing coordinates to transform ("-" to read from stdin)
Local x,y coordinates to target east,north
-s
Display summary information
-r
Reverse transform of coords file or coeff. dump
Target east,north coordinates to local x,y
-x
Display transform matrix coefficients
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
group : str, required
Name of input imagery group
Used as: input, group, name
order : int, required
Rectification polynomial order
Allowed values: 1-3
Default: 1
format : str | list[str], optional
Output format
Allowed values: idx, src, dst, fwd, rev, fxy, rxy, fd, rd
idx: point index
src: source coordinates
dst: destination coordinates
fwd: forward coordinates (destination)
rev: reverse coordinates (source)
fxy: forward coordinates difference (destination)
rxy: reverse coordinates difference (source)
fd: forward error (destination)
rd: reverse error (source)
Default: fd,rd
input : str, optional
File containing coordinates to transform ("-" to read from stdin)
Local x,y coordinates to target east,north
Used as: input, file, name
flags : str, optional
Allowed values: s, r, x
s
Display summary information
r
Reverse transform of coords file or coeff. dump
Target east,north coordinates to local x,y
x
Display transform matrix coefficients
verbose : bool, optional
Verbose module output
Default: None
quiet : bool, optional
Quiet module output
Default: None
superquiet : bool, optional
Very quiet module output
Default: None
group : str, required
Name of input imagery group
Used as: input, group, name
order : int, required
Rectification polynomial order
Allowed values: 1-3
Default: 1
format : str | list[str], optional
Output format
Allowed values: idx, src, dst, fwd, rev, fxy, rxy, fd, rd
idx: point index
src: source coordinates
dst: destination coordinates
fwd: forward coordinates (destination)
rev: reverse coordinates (source)
fxy: forward coordinates difference (destination)
rxy: reverse coordinates difference (source)
fd: forward error (destination)
rd: reverse error (source)
Default: fd,rd
input : str | io.StringIO, optional
File containing coordinates to transform ("-" to read from stdin)
Local x,y coordinates to target east,north
Used as: input, file, name
flags : str, optional
Allowed values: s, r, x
s
Display summary information
r
Reverse transform of coords file or coeff. dump
Target east,north coordinates to local x,y
x
Display transform matrix coefficients
verbose : bool, optional
Verbose module output
Default: None
quiet : bool, optional
Quiet module output
Default: None
superquiet : bool, optional
Very quiet module output
Default: None
Returns:
result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None
will be returned.
DESCRIPTION
m.transform is an utility to compute transformation based upon GCPs and output error measurements.
If coordinates are given with the input file option or fed from
stdin
, both the input and the output format is "x y" with one
coordinate pair per line. Reverse transform is performed with the -r
flag.
The format option determines how control points are printed out. A summary on the control points can be printed with the -s flag. The summary includes maximum deviation observed when transforming GCPs and overall RMS. The format option is ignored when coordinates are given with the input file option.
NOTES
The transformations are:
order=1:
e = [E0 E1][1]·[1]
[E2 0][e] [n]
n = [N0 N1][1]·[1]
[N2 0][e] [n]
order=2:
e = [E0 E1 E3][1 ] [1 ]
[E2 E4 0][e ]·[n ]
[E5 0 0][e²] [n²]
n = [N0 N1 N3][1 ] [1 ]
[N2 N4 0][e ]·[n ]
[N5 0 0][e²] [n²]
order=3:
e = [E0 E1 E3 E6][1 ] [1 ]
[E2 E4 E7 0][e ]·[n ]
[E5 E8 0 0][e²] [n²]
[E9 0 0 0][e³] [n³]
n = [N0 N1 N3 N6][1 ] [1 ]
[N2 N4 N7 0][e ]·[n ]
[N5 N8 0 0][e²] [n²]
[N9 0 0 0][e³] [n³]
["·" = dot-product, (AE)·N = N'EA]
In other words, order=1 and order=2 are equivalent to order=3 with the higher coefficients equal to zero.
SEE ALSO
i.ortho.transform, i.rectify, v.rectify, v.transform
AUTHORS
Brian J. Buckley
Glynn Clements
Hamish Bowman
SOURCE CODE
Available at: m.transform source code
(history)
Latest change: Thursday Jul 24 04:25:59 2025 in commit 7882012