Show / Hide Table of Contents

Method GetTransformation

GetTransformation(SpatialReference, SpatialReference)

Gets the best usable (default) transformation to transform between the input and output spatial references, without taking into account an area of interest.

Declaration
public static DatumTransformation GetTransformation(SpatialReference inputSpatialReference, SpatialReference outputSpatialReference)
Parameters
Type Name Description
SpatialReference inputSpatialReference

The SpatialReference to use as the input.

SpatialReference outputSpatialReference

The SpatialReference to use as the output.

Returns
Type Description
DatumTransformation

A DatumTransformation instance that represents the best choice given the parameters. Always returns a usable transformation where IsMissingProjectionEngineFiles is false. Returns null if no usable transformation is available for the given input parameters, or if no transformation is required.

Prior to version 100.9, this method returned a GeographicTransformation.

From version 100.9 onwards, if both inputSpatialReference and outputSpatialReference have a vertical coordinate system, this method returns a HorizontalVerticalTransformation instance. If either SpatialReference does not have a vertical coordinate system, a GeographicTransformation is returned. To replicate the former behavior, use the GetTransformation(SpatialReference, SpatialReference, Envelope, Boolean) method instead with ignoreVertical = true.

Remarks

The default transformation is the one that is used when calling Project(Geometry, SpatialReference) without specifying a transformation.

See Also
GetTransformation(SpatialReference, SpatialReference, Envelope)

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.2.1 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.2.1 - 100.15
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 100.15

GetTransformation(SpatialReference, SpatialReference, Envelope)

Gets the best usable transformation to transform between the input and output spatial references and takes into account the area of interest, if specified.

Declaration
public static DatumTransformation GetTransformation(SpatialReference inputSpatialReference, SpatialReference outputSpatialReference, Envelope areaOfInterest)
Parameters
Type Name Description
SpatialReference inputSpatialReference

The SpatialReference to use as the input.

SpatialReference outputSpatialReference

The SpatialReference to use as the output.

Envelope areaOfInterest

The bounding box of coordinates to be transformed, or null to consider the entire world extent.

Returns
Type Description
DatumTransformation

A DatumTransformation instance that represents the best choice given the parameters. Always returns a usable transformation where IsMissingProjectionEngineFiles is false. Returns null if no usable transformation is available for the given input parameters, or if no transformation is required.

Prior to version 100.9, this method returned a GeographicTransformation.

From version 100.9 onwards, if both inputSpatialReference and outputSpatialReference have a vertical coordinate system, this method returns a HorizontalVerticalTransformation instance. If either spatial reference does not have a vertical coordinate system, a GeographicTransformation is returned. To replicate the former behavior, use the GetTransformation(SpatialReference, SpatialReference, Envelope, Boolean) method instead with ignoreVertical = true.

Remarks

If areaOfInterest is null or IsEmpty, the returned transformation does not take into account an area of interest, and the best choice for the entire world extent is effectively assumed.

Otherwise, if areaOfInterest does not intersect the area of use of inputSpatialReference, this method returns null.

If the SpatialReference of the areaOfInterest differs from inputSpatialReference, then areaOfInterest is reprojected to inputSpatialReference.

A geographic area containing coordinates to be transformed, expressed as an Envelope.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.3 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.2.1 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.7 - 100.12
Xamarin.Android100.2.1 - 100.15
Xamarin.iOS100.2.1 - 100.15
UWP100.2.1 - 100.15

GetTransformation(SpatialReference, SpatialReference, Envelope, Boolean)

Returns the best usable transformation used to transform between the input and output spatial references, taking into account the area of interest, if specified. Optionally disregards any vertical transformations.

Declaration
public static DatumTransformation GetTransformation(SpatialReference inputSpatialReference, SpatialReference outputSpatialReference, Envelope areaOfInterest, bool ignoreVertical)
Parameters
Type Name Description
SpatialReference inputSpatialReference

The spatial reference to use as the input.

SpatialReference outputSpatialReference

The spatial reference to use as the output.

Envelope areaOfInterest

The bounding box of coordinates to be transformed, or null to consider the entire world extent. If areaOfInterest is null or IsEmpty, the returned transformation does not take into account an area of interest, and the best choice for the entire world extent is effectively assumed. Otherwise, if areaOfInterest does not intersect the area of interest use of inputSpatialReference, this method returns null. If the SpatialReference of areaOfInterest differs from inputSpatialReference, then areaOfInterest will first be reprojected to inputSpatialReference.

Boolean ignoreVertical

true if transformation catalog should ignore any vertical coordinate system set on the inputSpatialReference or outputSpatialReference, and only consider horizontal (geographic) transformations; false otherwise.

Returns
Type Description
DatumTransformation

A DatumTransformation instance that represents the best choice given the parameters. Always returns a usable transformation where IsMissingProjectionEngineFiles is false. The specific type returned depends on the given value of the ignoreVertical parameter. Returns null if no transformation is required for the given input parameters, or if no usable transformation is available.

Remarks

Use this method to determine whether or not any vertical coordinate systems set on the spatial reference parameters should be accounted for in the returned transformation. This method can be used to replicate the former (prior to version 100.9.0) behavior of the GetTransformation(SpatialReference, SpatialReference) and GetTransformation(SpatialReference, SpatialReference, Envelope). Calling this method with ignoreVertical = false is equivalent to calling GetTransformation(SpatialReference, SpatialReference, Envelope). Calling this method with ignoreVertical true is equivalent to calling GetTransformation(SpatialReference, SpatialReference, Envelope) in releases prior to 100.9.0.

Applies to

Platforms and versions
TargetVersions
.NET Standard 2.0100.10 - 100.15
.NET 6.0100.13 - 100.15
.NET 6.0 Windows100.13 - 100.15
.NET Framework100.10 - 100.15
.NET 5100.10 - 100.12
.NET Core 3.1100.10 - 100.12
Xamarin.Android100.10 - 100.15
Xamarin.iOS100.10 - 100.15
UWP100.10 - 100.15
In This Article
Back to top Copyright © 2022 Esri.