Hi there--
In the ArcGIS Pro SDK for 3.4, we are attempting to save a custom geographic transformation to the current Map.
As an example, the transformation that we are using transforms between the European Datum of 1950 to WGS 1984 by using the position vector method with customize parameters. This is the custom WKT that we have for this transformation:
GEOGTRAN["European Datum (1950) - NW Spain",GEOGCS["GCS_European_1950",DATUM["D_European_1950",SPHEROID["International_1924",6378388.0,297.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],METHOD["Position_Vector"],PARAMETER["X_Axis_Translation",-178.4],PARAMETER["Y_Axis_Translation",-83.2],PARAMETER["Z_Axis_Translation",-221.3],PARAMETER["X_Axis_Rotation",0.54],PARAMETER["Y_Axis_Rotation",-0.532],PARAMETER["Z_Axis_Rotation",-0.126],PARAMETER["Scale_Difference",21.2],OPERATIONACCURACY[1.5]]
Then we create the Geographic Transformation using the WKT:
//wkt is equal to the string pasted previously.
GeographicTransformation transform = GeographicTransformation.Create(wkt);
The WKT used above is valid, as it's able to be used for transforming coordinates using the GeometryEngine, for instance.
When we go to store it in the Map, we do the following:
await QueuedTask.Run(() =>
{
CIMMap mapDef = map.GetDefinition();
List<CIMDatumTransform> cimDatumTransforms = mapDef.DatumTransforms.ToList();
//add the previous geographic transformation to the list
CIMDatumTransform newTransform = new CIMDatumTransform()
{
GeoTransformation = transform,
Forward = true
};
cimDatumTransforms.Add(newTransform);
mapDef.DatumTransforms = cimDatumTransforms;
map.SetDefinition(mapDef);
});
The adding of the new transformation occurs without error; if I export the map to a MapX file and open it in a external editor, I can see the custom datum transformation is added to two other transformations generated by Pro for these two datum pairs.
However, when I open the map properties and go to Transformations, then scroll through the list in the combobox, the custom transformation does not show up.
Additionally, we have found that using the Custom Geographic Transformation geoprocessing tool to create the geographic transformation and saving it to a file in %appdata%\ESRI\ArcGISPro\ArcToolbox\CustomTransformations does cause it to be read by the Transformations page and added to the list, as might be expected. However, we would like to avoid this if possible and keep things in memory.
The question then is: Is there a way to add a custom geographic transformation to the map and have it viewable (and selectable) in the map properties' Transformations page without having to use the geoprocessing tool to create a file copy of it?
Thank you,
Matt Winslett
T-Kartor