I've used GDAL Python binding to create a geographic transformation between two geographic coordinate systems for Mercury (they differ only in the semi-major axis used in the datum).

import ogr, osr

inSpatialRef = osr.SpatialReference()
inSpatialRef.ImportFromWkt('source wkt string here')

outSpatialRef = osr.SpatialReference()
outSpatialRef.ImportFromWkt('target wkt string here')

coordTransform = osr.CoordinateTransformation(inSpatialRef, outSpatialRef)

My question is, how do I output the transformation parameters from osr.CoordinateTransformation so I can use them to create a custom geographic transformation in ArcGIS?

I'm assuming it's creating a 3 or 7-parameter transform, is this correct?


You're not passing in any control points that are in both systems so it can't be creating a custom 3- or 7- parameter transformation. I assume it's looking up via a table of some sort for an existing transformation between the input and output spatial references.

Backed up by this doc. See the Caution which states:

the coordinate transformation object returned can be in a non working state if no coordinate transformation can be established between src and dst, and calling other methods on it can result in the process termination. If using GDAL 1.10 or above, it is recommended to use the CreateCoordinateTransformation(org.gdal.osr.SpatialReference, org.gdal.osr.SpatialReference) method instead.

If all that differs are the ellipsoids, use the create custom geographic transformation tool in ArcMap with the method set to geocentric translation and the parameter values set to zeroes. The algorithm will pick up the difference in the ellipsoids when it converts the input lat/lon values to XYZ using the input ellipsoid, then uses the output ellipsoid to convert back to lat/lon at the end.

  • Thanks, should that method be applicable to both defining the transformation to use with ArcMap's project-on-the-fly capability and for projecting shapefiles? For me, it worked for projecting shapefiles but the transform does not show up in the Data Frame Properties -> Transformation's window
    – meguh78
    Aug 10 '17 at 21:17
  • Yes, if you use the tool, it writes out a .gtf file. If you use the option within the transformations dialog itself in ArcMap it is only for the map.
    – mkennedy
    Aug 10 '17 at 21:20
  • I see the .gtf file in %appdata% but ArcMap does not show it in the Data Frame Properties geographic coordinate system transformations window. Any suggestions on how to get it to show?
    – meguh78
    Aug 10 '17 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.