ArcGIS Explorer Component Help |
GeographicTransformationCollection..::.Add Method |
GeographicTransformationCollection Class Example See Also |
Adds the specified GeographicTransformation to the collection.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public void Add( GeographicTransformation gt ) |
Visual Basic (Declaration) |
---|
Public Sub Add ( _ gt As GeographicTransformation _ ) |
Parameters
- gt
- Type: ESRI.ArcGISExplorer.Geometry..::.GeographicTransformation
The transformation to add to the collection.
Remarks
Any transformation added to the collection of transformations stored in the GeographicTransformations2D or GeographicTransformations3D properties can be used by the application when performing on-the-fly transformations of layers or graphics in the map; the collection used depends on whether the current DisplayMode is 2D or 3D.
As each transformation is specific to a particular pair of CoordinateSystems, you cannot add a transformation to the collection with the same CoordinateSystem pair as a transformation already in the collection.
Examples
The code below shows how you can create a GeographicTransformation directly if you know
the unique identifier. After reporting a few properties, the transformation is then added
to the collection held by the Map object, so that it can be used in on-the-fly projections.
CopyC#
// Create a GeographicTransformation with a known identifier - the code below will // create the transformation 1139, suitable for locations in Finland and Norway. GeographicTransformation ed1950ToWGS84 = new GeographicTransformation(1139); System.Diagnostics.Debug.WriteLine("The GeographicTransformation:"); System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.Name); System.Diagnostics.Debug.WriteLine("Converts between the coordinate systems:"); System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.CoordinateSystem1.Name); System.Diagnostics.Debug.WriteLine("and"); System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.CoordinateSystem2.Name); // Add the transformation to the Map for use in on-the-fly transformations. // The variable 'currentMap' should point to the current MapDisplay object. // We add this transformation to the 2D transformations collection. currentDisplay.GeographicTransformations2D.Add(ed1950ToWGS84);
CopyVB.NET
' Create a GeographicTransformation with a known identifier - the code below will ' create the transformation 1139, suitable for locations in Finland and Norway. Dim ed1950ToWGS84 As New GeographicTransformation(1139) System.Diagnostics.Debug.WriteLine("The GeographicTransformation:") System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.Name) System.Diagnostics.Debug.WriteLine("Converts between the coordinate systems:") System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.CoordinateSystem1.Name) System.Diagnostics.Debug.WriteLine("and") System.Diagnostics.Debug.WriteLine(ed1950ToWGS84.CoordinateSystem2.Name) ' Add the transformation to the Map for use in on-the-fly transformations. ' The variable 'currentMap' should point to the current MapDisplay object. ' We add this transformation to the 2D transformations collection. currentDisplay.GeographicTransformations2D.Add(ed1950ToWGS84)
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentNullException | The added gt cannot be null. |
System..::.ArgumentException | The added gt cannot be null. |