Affine transformation
Added in version 6.0.0.
The affine transformation applies translation and scaling/rotation terms on the x,y,z coordinates, and translation and scaling on the temporal coordinate.
Alias |
affine |
Domain |
4D |
Input type |
XYZT |
output type |
XYZT |
By default, the parameters are set for an identity transforms. The transformation is reversible unless the determinant of the sji matrix is 0, or tscale is 0
This can be used to implement:
EPSG "Affine parametric transformation" of code 9624 by setting A0, A1, A2, B0, B1, B2 EPSG parameters to respectively xoff, s11, s12, yoff, s21, s22 PROJ parameters.
EPSG "Similarity transformation" of code 9621 by setting:
xoff to \(X_{T0}\)
yoff to \(Y_{T0}\)
s11 to \(M \cos \theta\)
s12 to \(M \sin \theta\)
s21 to \(-M \sin \theta\)
s22 to \(M \cos \theta\)
where:
\(X_{T0}\) is the first ordinate of the origin point of the source CRS expressed in the target CRS.
\(Y_{T0}\) is the second ordinate of the origin point of the source CRS expressed in the target CRS.
\(M\) is the multiplication factor applied to coordinates in the source CRS to obtain the correct scale of the target CRS.
\(\theta\) is the angle about which the axes of the source CRS need to be rotated to coincide with the axes of the target CRS, counter-clockwise being positive
Examples
The +proj=affine operation applies an affine transformation on coordinate values. Note that it does not perform any unit conversion and will accept coordinates whether they are angular or linear. Users must ensure that the values provided to the affine operation are expressed in the appropriate units for their intended purpose.
The affine operation can be used with the cct utility or as a step inside a PROJ pipeline.
Offsetting a the x-component of a coordinate by 1:
echo "1 2" | cct +proj=affine +xoff=1
Parameters
Optional
- +xoff=<value>
Offset in X. Default value: 0
- +yoff=<value>
Offset in Y. Default value: 0
- +zoff=<value>
Offset in Z. Default value: 0
- +toff=<value>
Offset in T. Default value: 0
- +s11=<value>
Rotation/scaling term. Default value: 1
- +s12=<value>
Rotation/scaling term. Default value: 0
- +s13=<value>
Rotation/scaling term. Default value: 0
- +s21=<value>
Rotation/scaling term. Default value: 0
- +s22=<value>
Rotation/scaling term. Default value: 1
- +s23=<value>
Rotation/scaling term. Default value: 0
- +s31=<value>
Rotation/scaling term. Default value: 0
- +s32=<value>
Rotation/scaling term. Default value: 0
- +s33=<value>
Rotation/scaling term. Default value: 1
- +tscale=<value>
Time scaling term. Default value: 1