FME Transformers: 2024.1

Categories
Coordinates
Related Transformers
3DAffiner
3DRotator
AffineWarper
Offsetter
PointCloudTransformationApplier
RasterRotationApplier
Rotator
Scaler
SecondOrderConformer

Affiner

Performs an affine transformation (such as offset, rotate, or scale) on the coordinates of the feature.

Jump to Configuration

Typical Uses

  • Moving, scaling, and rotating 2D geometry.

How does it work?

The Affiner receives features with any geometry type and moves their x and y coordinates according to a specified affine transformation.

An affine transformation is a mathematical method of modifying geometry that:

  • Preserves lines/collinearity: all points on a straight line are still on a straight line after transformation.

  • Preserves parallelism: lines that are initially parallel are still parallel after transformation.

  • May not preserve angles, lengths, or areas, depending on the type of transformation performed.

Scaling, mirroring, rotating, shearing, and translating (relocating or offsetting) are all affine transformations. They can be performed singly or in combination.

The Affiner performs 2D transformations, using this formula:

x' = Ax + By + C

y' = Dx + Ey + F

Where (x,y) are the input coordinates and (x',y') are the transformed output coordinates.

 

Description

Formula/Coefficients

Example*

Translate

Move the geometry a fixed distance.

x' = 1x + 0y + C

y' = 0x + 1y + F

Simplified:

x' = x + C
y' = y + F

C = horizontal (x) offset
F = vertical (y) offset

x' = 1x + 0y + 5
y' = 0x + 1y + 5

Scale

Shrink or enlarge the geometry.

 

x' = Ax + 0y + 0
y' = 0x + Ey + 0

Simplified:

x' = Ax
y' = Ey

A = horizontal (x) scale factor
E = vertical (y) scale factor

x' = 1.5x + 0y + 0
y' = 0x + 1.5y + 0

Rotate

Rotate the geometry around the origin.

 

x' = cos(ϴ)x + −sin(ϴ)y + 0
y' = sin(ϴ)x + cos(ϴ)y + 0

Simplified:

x' = cos(ϴ)x sin(ϴ)y
y' = sin(ϴ)x + cos(ϴ)y

ϴ = Angle in degrees

A = cos(ϴ)
B = −sin(ϴ) (Note negative value)
D = sin(ϴ)
E = cos(ϴ)

Rotate 30 degrees:

x' = 0.866025x + -0.5y + 0
y' = 0.5x + 0.866025y + 0

Shear

Offset geometry in proportion to its x and y coordinates.

x' = 1x + By + 0
y' = Dx + 1y + 0

Simplified:

x' = x + By
y' = y + Dx

x' = 1x + 1.25y + 0
y' = 0x + 1y + 0

* Note these examples use geometry with an origin of 0,0 at the lower left corner of the polygon.

Geographic Features and Affine Transformations

The origin (0,0) of geographic features is generally at a distance from the geometry itself, and so affine transformations can produce large location shifts, in particular when scaling or rotating.

Examples

Usage Notes

  • To perform affine transformations in place on geographic features, consider temporary reprojection (Reprojector) to a local coordinate system or using the CommonLocalReprojector.

  • The Scaler performs 2D and 3D scaling affine transformations, with additional options for specific geometry types and origin handling.

  • The Offsetter performs 2D and 3D translation affine transformations, with additional coordinate space options (polar and spherical coordinates, in addition to cartesian).

  • The Rotator and 3DRotator perform rotation affine transformations, with a simplified interface for rotation value, origin (2D) and axis choice (3D).

Configuration

Input Ports

Output Ports

Parameters

Editing Transformer Parameters

Transformer parameters can be set by directly entering values, using expressions, or referencing other elements in the workspace such as attribute values or user parameters. Various editors and context menus are available to assist. To see what is available, click beside the applicable parameter.

For more information, see Transformer Parameter Menu Options.

Reference

Processing Behavior

Feature-Based

Feature Holding

No

Dependencies None
Aliases  
History  

FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for all results about the Affiner on the FME Community.

 

Examples may contain information licensed under the Open Government Licence – Vancouver, Open Government Licence - British Columbia, and/or Open Government Licence – Canada.