This document is archived and information here might be outdated.  Recommended version.


IQueryResultOptions.GeoTransformation Property (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IQ > IQueryResultOptions Interface > IQueryResultOptions.GeoTransformation Property
ArcGIS Developer Help

IQueryResultOptions.GeoTransformation Property

Geo transformation required to transform the geometry if the requested GCS is different from the source.

[Visual Basic .NET]
Public Property GeoTransformation As IGeoTransformation
[C#]
public IGeoTransformation GeoTransformation {get; set;}
[C++]
HRESULT get_GeoTransformation(
  IGeoTransformation** geotransform
);
[C++]
HRESULT putref_GeoTransformation(
  IGeoTransformation* geotransform
);
[C++]
Parameters
geotransform [out, retval]

geotransform is a parameter of type IGeoTransformation** geotransform [in]
geotransform is a parameter of type IGeoTransformation*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

In some instances the QueryResult may require a GeoTransformation . For example, a given map service may be using a spatial reference system based on GCS_WGS_1984, found in the DefaultMapDescription. A client wants to display QueryFeatureData2 results based on this map service in a different spatial reference, GCS_European_1950. The results will use the spatial reference of the DefaultMapDescription, GCS_WGS_1984, and display these results, incorrectly in GCS_European_1950. Features may not "line up" correctly. In order to correctly display these results a GeoTransformation is needed. Applying the correct GeoTransformation ensures the spatial correctness of the result.

Another instance where a GeoTransformation may be need to be specified in the QueryResultsOption is if the queried layer is projected on the fly within the map service, that is coordinate system of the layer's source is different than the DefaultMapDescription coordinate system, and no appropriate transformation has been set in the map document before serving. In this case, you can access the the coordinate system of a layer source by first getting the layer's MapLayerInfo, then get Fields from MapLayerInfo, then get a single Field from Fields, then get GeometryDef from Field, and finally, get the SpatialReference from GeometryDef.

A GeoTransformation is not needed if different projected coordinate systems share the same underlying geographic coordinate system. For best results it is optimal for data (layers within the map service), map service and MapServer output to be in the same coordinate system.

[Visual Basic .NET]

Dim pSRFactory As ISpatialReferenceFactory2
pSRFactory = New SpatialReferenceEnvironment
Dim pGeoTrans As IGeoTransformation
pGeoTrans = pSRFactory.CreateGeoTransformation(esriSRGeoTransformation3Type.esriSRGeoTransformation_NAD_1927_To_WGS_1984_30)
pQueryResultOptions.GeoTransformation = pGeoTrans

See Also

IQueryResultOptions Interface