Skip to main content
Apply an affine transformation to the given geometry. ST_Affine has 2 overloaded signatures: Based on the invoked function, the following transformation is applied: x = a * x + b * y + c * z + xOff OR x = a * x + b * y + xOff y = d * x + e * y + f * z + yOff OR y = d * x + e * y + yOff z = g * x + f * y + i * z + zOff OR z = g * x + f * y + zOff If the given geometry is empty, the result is also empty. ST_Affine

Signatures

Parameters

geometry
Geometry
required
The input geometry to transform.
a
Double
required
The a coefficient of the affine transformation matrix.
b
Double
required
The b coefficient of the affine transformation matrix.
c
Double
The c coefficient of the affine transformation matrix (3D variant only).
d
Double
required
The d coefficient of the affine transformation matrix.
e
Double
required
The e coefficient of the affine transformation matrix.
f
Double
The f coefficient of the affine transformation matrix (3D variant only).
g
Double
The g coefficient of the affine transformation matrix (3D variant only).
h
Double
The h coefficient of the affine transformation matrix (3D variant only).
i
Double
The i coefficient of the affine transformation matrix (3D variant only).
xOff
Double
required
The X translation offset.
yOff
Double
required
The Y translation offset.
zOff
Double
The Z translation offset (3D variant only).

Return type

The resulting geometry.

Examples

Input: LINESTRING EMPTY
Input: POLYGON ((1 0 1, 1 1 1, 2 2 2, 1 0 1))
Input: POLYGON ((1 0, 1 1, 2 1, 2 0, 1 0), (1 0.5, 1 0.75, 1.5 0.75, 1.5 0.5, 1 0.5))
Input: POLYGON EMPTY
Input: GEOMETRYCOLLECTION (MULTIPOLYGON (((1 0, 1 1, 2 1, 2 0, 1 0), (1 0.5, 1 0.75, 1.5 0.75, 1.5 0.5, 1 0.5)), ((5 0, 5 5, 7 5, 7 0, 5 0))), POINT (10 10))
Input: POLYGON ((1 0 1, 1 1 1, 2 2 2, 1 0 1))