Select to view content in your preferred language

DatumTransformation returns the wrong in and out SpatialReferences for the requested

74
1
Thursday
Labels (3)
YasunariTosa1
Emerging Contributor

I donwloaded Projection_Engine_Data_200_8_0 and expanded in my local directory.  I set TransformationCatalog.ProjectionEngineDirectory to this directory.   I did the following to retrieve DatumTransformation:

SpatialReference inSP = SpatialReference.Create(3338); // Alaska Albers
SpatialReference outSP = SpatialReference.Create(3857); // WGS84 Web Mercator Auxiliary Sphere
DatumTransformation defaultDT = TransformationCatalog.GetTransformation(inSP, outSP);
The problem with defaultDT has the wrong InputSpatialReference(4269) and OutputSpatialReference(4326😞

YasunariTosa1_0-1760026358654.png

Try to get more by using GetTransformationsBySuitability:

IReadOnlyList<DatumTransformation> tfLists =
TransformationCatalog.GetTransformationsBySuitability(inSP, outSP);
var foundDTLists = tfLists.Where(dt => dt.InputSpatialReference.Wkid == 3338).ToList(); // returns 0!

Is there a way to get DatumTransformation with input reference to wkid =3338?

0 Kudos
1 Reply
ShellyGill1
Esri Contributor

Hi @YasunariTosa1 ,

I think this could be down to expecations of the input & output spatial reference of a transformation, and the doc not being good enough here. Transformations deal with a change in datum, and that's part of the underlying geographic coordinate system.

If your input or output spatial references are projected (which they both are in your case above - IsProjected==true), then instead of checking the WKID directly, check the BaseGeographic.WKID property instead. E.g I'd expect the inSP.BaseGeographic.WKID to be 4269, and equal to defaultDT.InputSpatialReference.WKID.

This isnt detailed in API reference for DatumTransformation though - I'll submit an issue to get this documentation updated with this information - thanks for highlighting it to us.

0 Kudos