Affiner
From Fmepedia
Affiner is a Workbench Transformer.
This transformer performs an affine transformation on the coordinates of the feature.
Affiner Q+A
How do I use the Affiner?
To use this transformer, you need to provide the 6 parameters that drive the following affine transform equation:
x' = Ax + By + C y' = Dx + Ey + F
Where (x,y) is the input point and (x',y') is the transformed output point.
This is best understood by providing 3 examples: translation, scaling and rotation.
Q) How do I translate features east and northward?
A) Translation:
To move features 500 units east and 1000 units north, you would need to use the following formula:
x' = 1x + 0y + Easting y' = 0x + 1y + Northing
x' = 1x + 0y + 500 y' = 0x + 1y + 1000
You would then enter the corresponding values for A to F in the Affiner parameters (e.g. A=1, B=0, C=500, D=0, E=1, F=1000)
Q) How do I scale a feature set?
A) Scaling:
To scale features by factor R, you need to use the scale factor to the X and Y terms as follows:
x' = Rx + 0y + 0 y' = 0x + Ry + 0
A increase the scale by 10 times use the following:
x' = 10x + 0y + 0 y' = 0x + 10y + 0
Q) How can I rotate my features?
A) Rotation:
To rotate features you need to apply the appropriate cos and sin functions associated with the rotation angle to the X,Y coefficients:
x' = cos(w)x + -sin(w)y + 0 y' = sin(w)x + cos(w)y + 0
where w = angle of rotation.
So, for a rotation of 30 degrees, cos(30) = 0.866025, sin(30) = 0.5, so we use:
x' = 0.866025*x + -0.5*y + 0 y' = 0.5*x + 0.866025*y + 0
to rotate a set of features by 30 degrees.
Q) How can I combine transformations?
A) You can also combine a set of transformations into one formula, or perform them in series to make it easier to debug or edit. For example, it may be easier to do your rotation and then scaling in 2 different transformers rather than trying to combine them into one transformation. Naturally, one advantage to doing it all in one transformation would be speed.
Hint: Use 'Show Summary Annotation' on the Affiner to preview the transformation formula that will be used.
