Thanks, Venkat.
Is there an event that fires before ArcMap starts the automatic transformation?
Is this automatic transformation done using a geoprocessor? If so, how do I get access to the geoprocessor so I can handle its ToolExecuting event?
I'm looking for something that will allow me to hook into ArcMap in order to possibly update the IGeoTransformation before the input features get transformed to the data frame's coordinate system.
Thanks,
Bob
Private Function MXDocument_NewDocument() as Boolean ' Start by getting a handle on the current FocusMap Dim pMxDoc As IMxDocument Set pMxDoc = Application.Document Dim pMap As IMap Set pMap = pMxDoc.FocusMap Dim pSpRFc As SpatialReferenceEnvironment Set pSpRFc = New SpatialReferenceEnvironment Dim pAlaskaNADCON As IGeoTransformation set pAlaskaNADCON = pSpRFc.CreateGeoTRansformation(esriSRGeoTransformation_NAD_1927_TO_NAD_1983_AK) ' Add the transformation to the operation set Dim pGTSet As IGeoTransformationOperationSet Set pGTSet = New GeoTransformationOperationSet ' The Map uses IMapGeographicTransformations to access the geogtrans Dim pMapGeo As IMapGeographicTransformations Set pMapGeo = pMap Set pGTSet = pMapGeo.GeographicTransformations pGTSet.Set esriTransformForward, pAlaskaNADCON pGTSet.Set esriTransformReverse, pAlaskaNADCON End Function
Thanks, Melita. That info looks promising.
A couple of questions:
1) In your example, you say that only NAD_1927_To_NAD_1983_NADCON is loaded by default, then the code adds NAD_1927_TO_NAD_1983_AK to the collection. Does this replace the original NAD_1927_To_NAD_1983 transformation, or add a second one? If it adds a second one, how does ArcMap determine which one to use when converting from NAD27 to NAD83? Does it prompt the user?
2) Will changes to the geographic transformation list is be saved with the map document?
Cheers,
Bob
Thanks, Melita. Just a couple more questions:
1) Is it possible to store the geographic transformation on the layer, rather than on the map, so that each layer could use a different transformation? I looked through the documentation and I didn't see anything, so I suspect the answer is 'no', but I thought I would ask anyway.
2) Can I create an IGeoTransformation using an EPSG code instead of the ESRI code, or map an EPSG code to its associated ESRI code? I tried to create a NAD83 to WGS84 NADCON transformation using the EPSG code, but I got an error saying that the code was not valid for a geographic transformation. The documentation describes a method for creating a spatial reference from an EPSG code, but not a geographic transformation.
Thanks.
Bob