updated: 24-Mar-2011
Copan for Windows
Coordinate Transformations
Contents
You will often need to geometrically transform the coordinates of a group of points,
for example, between a local ground coordinate system and a regional grid system.
The need may be for a permanent change to a coordfile or for just a temporary transformation during an import/export process.
Use this module to geometrically transform a set of points, either
- directly by specifying the known parameters of an affine transformation, or
- indirectly by specifying pairs of control points for a similarity transformation from one coordinate system to another.
In each case, rotations are always about a vertical axis, i.e., the horizontal planes of each coordinate system are assumed to be parallel.
1. Transforming Coordinates by Parameters
You can specify up to seven plus two
parameters of an affine transformation.
The seven affine transformation parameters are a 1D rotation, a 3D scaling, and a 3D shift (slide or translation).
Of course, any of the parameters may be left in their trivial form (i.e., rotation = 0, scale = 1, shift = 0).
The additional two parameters are the 2D coordinates of a pivot point
that is temporarily fixed with respect to rotation and scale.
To Transform by Parameters
-
Either Calculation | Transform Coords... | By Parameters... to change a coordfile's point coordinates,
or choose Yes... under Apply Transformation from within an import/export module to change the coordinates during the import/export process and leave the source points unchanged.
-
Optionally Load... a transformation Parameters file.
-
Enter the
Pivot point number or the
Northing and Easting
of a location about which the rotation should pivot or from which the scaling should occur.
-
For a Rotation, enter the Angle (+ve clockwise).
-
For a Scale change,
- choose Uniform or Differential scaling, and
- enter the Scale Factor and choose the Units Factor (optionally inverting them via 1/SF and 1/UF) as appropriate, or enter the scale values directly.
-
Optionally Scale extended-code sizes. This will scale any point codes that are sized according to the rules in § Point Codes by the Elev Scale present. (The Z-scale is used, rather than the N/E-scale, to prevent influence from the SF.)
-
For a Shift, enter either a shift expression
(see § Shift Expressions)
or the Northing, Easting and Elevation values to be added.
-
Optionally Save the Transformation parameters file for later reuse.
-
Choose which Points to transform: All of them or Filter... a subset
(See § Point Filters).
-
Transform or OK. The sequence will be rotation, scale, then shift.
-
Optionally Reverse transform the points.
This performs the specified transformation in reverse (so effectively acts as an Undo button).
click for larger view
Notes
-
A transformation Parameters file is a binary file, and while it can have any name, it ought to have a .tfm name extension.
-
Scale Factor represents a combined map projection and sea-level conversion factor, and applies only to horizontal distances (i.e., North and East dimensions).
-
Units Factor is for height and distance unit conversion (e.g., feet to metres) so applies to all three coordinate dimensions, and to extended-code sizes (if requested).
2. Transforming Coordinates by Control Points
Suppose you have a set of points to transform from one coordinate system, the source system, to another, the target system.
You can estimate a best-fit transformation between specified lists of control points —
points whose coordinates are available in both systems — then do the transformation.
The estimation is by least-squares and can be for
- a 3-parameter rigid-body transformation, having a 1D rotation and a 2D shift or
- a 4-parameter similarity transformation (or Helmert transformation), having a 1D rotation, a 1D scale, and a 2D shift.
The rotation and scale (if present) are with respect to the arbitrary 2D centroid of the source control points.
The least-squares solution is one that minimizes the sum of the squared residuals, where a residual is the difference between a tansformed source point and its corresponding target point.
To Transform by Control Points
-
Calculation | Transform Coords... | By Control Points...
-
Optionally Load... a Control Point Pairs file.
-
For each Source Control Point, enter the # and Add.
-
Do the same for each Target Control Point, ensuring that corresponding points are in the same order.
-
Select whatType of transformation: Rigid-body or Similarity.
-
Estimate the Parameters and examine the listed residuals.
-
Optionally Save... the Control Point Pairs for later reuse.
-
Optionally Save... the Parameters for later use in Transform by Parameters.
-
Choose which Source points to transform: All of them or Filter... a subset
(See § Point Filters).
Target points are automatically protected so will not get transformed.
-
Transform or OK.
-
Optionally Reverse transform the points. This performs the specified transformation in reverse (so effectively acts as an Undo button).
click for larger view
The Transformation Control Point Pairs File Format
This plain text (or ascii) file has
- Any name, though names with a .tcp extension is advisable.
- One heading line containing
Source
and Target
(exclude quotes and separate by whitespace).
- Pairs of corresponding source and target point numbers (separated by whitespace), one per line.
- Single-byte character encoding, such as ANSI, DOS or UTF-8.
Note: multi-byte character encodings (such as Unicode or UTF-16) will not work.
Example: Transformation control point pairs file.
Source Target
2 1002
3 1003
4 1004
Notes
-
The target control points must be in the same coordfile.
-
Any point that gets added to the target point list is automatically protected (prevented from being transformed) and remains so, even if subsequently removed from the list.
-
If only two pairs of control point are used to estimate a similarity transformation, an exact solution (not an estimate) is determined.
-
You can Remove items from the control point lists.
-
Transformed points are plotted in their new positions.
updated: 24-Mar-2011