﻿GeographicTransformation Class
A mathematical function used to increases accuracy of projection operations between coordinate systems if the reprojection involves a datum shift.

Namespace:  ESRI.ArcGISExplorer.Geometry

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

# Syntax

C#
`public sealed class GeographicTransformation : IXmlSerializable`
Visual Basic (Declaration)
```Public NotInheritable Class GeographicTransformation _
Implements IXmlSerializable```

# Remarks

Coordinate systems model the earths shape by using a 'datum', a mathematical model of a spheroid shape approximating the shape of the earth. There are many different datums which can be used to model the earth, and different coordinate systems may be based on different datums. A geographic transformation can optionally be used by the overloaded Project(Geometry, CoordinateSystem, GeographicTransformation) operation in order to increase accuracy by specifying a particular mathematical function to account for the difference in the datums, sometimes known as a 'datum shift', or 'geodetic transformation'. A GeographicTransformation object represents a specific transformation function that applies to transformations between the two coordinate systems specified in the CoordinateSystem1 and CoordinateSystem2 properties.

There are many different predefined GeographicTransformations available to choose from, and there is often more than one GeographicTransformation which applies to a pair of CoordinateSystems. The GetTransformations(CoordinateSystem, CoordinateSystem) static method allows you to retrieve a list of transformations appropriate for use for a specified pair of CoordinateSystems in order to choose which one to use.

Note that ArcGIS Explorer supports single transformations; composite transformations (where two or more transformation functions are combined together) are not supported.

GeographicTransformations apply to geographic coordinate systems; for projected coordinate systems a transformation applies to the BaseGeographicCoordinateSystem upon which a projected system is based. If the BaseGeographicCoordinateSystem of the projected coordinate system is the same no transformations are returned, the most likely reason is that they have the same underlying geographic coordinate system and therefore the same datum, so no datum shift is required.

The ArcGIS Explorer application maintains a collection of GeographicTransformations in the GeographicTransformations2D and GeographicTransformations3D properties. Adding a GeographicTransformation to these collection ensures it will be used in a call to Project, and would also be used internally to project any layers or graphics on-the-fly, if those objects have an appropriate coordinate system pair. The collection used depends on whether the current DisplayMode is 2D or 3D.

# Examples

The code below shows how you can use a GeographicTransformation to increase the accuracy of projecting a Point to a CoordinateSystem with a different datum. The initial Point is specified using a geographical coordinate system, with coordinates in lat, long. A new Point is then created by projecting the original into a projected coordinate system which is based on a different datum. A list of suitable GeographicTransformations is generated and the first suitable transformation is used in the Project operation.
CopyC#
```// Create a Point at Greenwich, UK. By default new Geometries have the WGS 1984 geographical coordinate system.
ESRI.ArcGISExplorer.Geometry.Point projectPoint = new ESRI.ArcGISExplorer.Geometry.Point(0, 51.4791);

// Create an instance of the CoordinateSystem we want to project the Point into.
CoordinateSystem projectInto = CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid;

// Retrieve suitable transformations between the two coordinate systems.
System.Collections.Generic.IList<GeographicTransformation> suitableTrans = GeographicTransformation.GetTransformations
(projectPoint.CoordinateSystem, projectInto);

ESRI.ArcGISExplorer.Geometry.Point outputPoint = null;
if (suitableTrans.Count > 0)
{
// Could display a list of suitable transformations to the user for selection.
// For brevity here, simply pick the first suitable transformation.
GeographicTransformation geoT = suitableTrans[0];

// Project the point using the selected transformation. Cast back to a Point - Project does
// not change the type of Geometry.
outputPoint = GeometryOperations.Project(projectPoint, projectInto, geoT) as ESRI.ArcGISExplorer.Geometry.Point;
}
else
{
// If no transformations are returned, the most likely reason is that there is no
// transformation required between the input and output systems, as they have the
// same underlying geographic coordinate system. This is not the case for the systems
// specified above but may apply to other coordinate system pairs.
// In this case, perform the projection without a transformation.
outputPoint = GeometryOperations.Project(projectPoint, projectInto) as ESRI.ArcGISExplorer.Geometry.Point;
}```
CopyVB.NET
```' Create a Point at Greenwich, UK. By default new Geometries have the WGS 1984 geographical coordinate system.
Dim projectPoint As New ESRI.ArcGISExplorer.Geometry.Point(0, 51.4791)

' Create an instance of the CoordinateSystem we want to project the Point into.
Dim projectInto As CoordinateSystem = CoordinateSystem.ProjectedCoordinateSystems.NationalGrids.Europe.BritishNationalGrid

' Retrieve suitable transformations between the two coordinate systems.
Dim suitableTrans As System.Collections.Generic.IList(Of GeographicTransformation) = GeographicTransformation.GetTransformations(projectPoint.CoordinateSystem, projectInto)

Dim outputPoint As ESRI.ArcGISExplorer.Geometry.Point = Nothing
If suitableTrans.Count > 0 Then
' Could display a list of suitable transformations to the user for selection.
' For brevity here, simply pick the first suitable transformation.
Dim geoT As GeographicTransformation = suitableTrans(0)

' Project the point using the selected transformation. Cast back to a Point - Project does
' not change the type of Geometry.
outputPoint = GeometryOperations.Project(projectPoint, projectInto, geoT)
Else
' If no transformations are returned, the most likely reason is that there is no
' transformation required between the input and output systems, as they have the
' same underlying geographic coordinate system. This is not the case for the systems
' specified above but may apply to other coordinate system pairs.
' In this case, perform the projection without a transformation.
outputPoint = GeometryOperations.Project(projectPoint, projectInto)
End If```

# Inheritance Hierarchy

System..::.Object

ESRI.ArcGISExplorer.Geometry..::.GeographicTransformation