Create Custom Geographic Transformation (Data Management)
Summary
Creates a transformation method for converting data between two geographic coordinate systems or datums. The output of this tool can be used as a transformation method for any tool with a parameter that requires a geographic transformation.
Usage
-
All custom geographic transformation files are saved with a .gtf extension and stored in the ESRI\<ArcGIS product>\ArcToolbox\CustomTransformations folder under the user's Application Data folder. The CustomTransformations folder is created by the tool if it does not exist. If the Application Data folder is read-only or hidden, the output is created in ArcToolbox\CustomTransformations under the user's temp folder. The location or name of the Application Data and temp folders is dependent on the operating system.
- In any Windows operating system the Application Data folder is located at %appdata% and the user's Temp folder is located at %temp%.
- In Unix systems, the tmp and Application Data folders are located in the user's home directory, under $HOME and $TMP, respective.
-
Any geoprocessing tool that uses geographic transformations will look at all custom transformations in the default storage location and present them as valid transformation options on the dialog box under the Geographic Transformation parameter's drop-down list.
-
Custom transformation files can't be edited. They are binary files that store version and string length information that may be corrupted if edited outside of the geoprocessing framework. To update the file you should create a new custom geographic transformation and overwrite the existing file.
Syntax
Parameter | Explanation | Data Type |
geot_name |
Name of the custom transformation method. All custom geographic transformation files are saved with a .gtf extension and stored in the ESRI\<ArcGIS product>\ArcToolbox\CustomTransformations folder under the user's Application Data folder. The CustomTransformations folder is created by the tool if it does not exist. If the Application Data folder is read-only or hidden, the output is created in ArcToolbox\CustomTransformations under the user's temp folder. The location or name of the Application Data and temp folders is dependent on the operating system.
| String |
in_coor_system |
The starting geographic coordinate system. | Coordinate System |
out_coor_system |
The final geographic coordinate system. | Coordinate System |
custom_geot |
Set the METHOD and PARAMETER values wrapped in a string for custom transformation GEOGTRAN. Set the name of the method from the available methods of Geocentric_Translation, Molodensky, Molodensky_Abridged, Position_Vector, Coordinate_Frame, Molodensky_Badekas, NADCON, HARN, NTV2, Longitude_Rotation, Unit_Change, and Geographic_2D_Offset. Each method has its own sets of parameters—you can edit the values of the parameters by entering text next to the name of the parameter within the whole string representation of the custom geographic transformation. See examples in the Python sample below. | String |
Code Sample
The following stand-alone script uses the CreateCustomGeoTransformation function to create a custom transformation for a particular use case. The output is a *.gtf file created in the default directory.
# Name: CreateCustomGeographicTransformation.py
# Description: Creates a custom geographic transformation in the default directory.
# import system modules
import arcpy
# set the variables
geoTransfmName = "cgt_geocentric2"
inGCS = "GEOGCS['GCS_Tokyo',DATUM['D_Tokyo',SPHEROID['Bessel_1841',6377397.155,299.1528128]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
outGCS = "GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]]"
customGeoTransfm = "GEOGTRAN[METHOD['Geocentric_Translation'],PARAMETER['X_Axis_Translation',''],PARAMETER['Y_Axis_Translation',''],PARAMETER['Z_Axis_Translation','']]"
arcpy.CreateCustomGeoTransformation_management(geoTransfmName, inGCS, outGCS, customGeoTransfm)