Add Datum Transform to Spatial Reference Environment, how?

137
4
06-29-2018 05:11 AM
Highlighted
New Contributor

In ArcObjects, we could call ISpatialReferenceFactory2::get_GeoTransformationDefaults() and then IGeoTransformationOperationSet::Set() to add GeoTransformations. Following that, calling Project() either explicitly or implicitly (e.g. when fetching a Raster with a different Spatial Reference) would use these as appropriate depending on the GCS of the Spatial References. Calling ProjectEx() was not required, and anyway would not be used in the implicit cases.

(In our particular case, we currently only need for an OSGB <-> WGS84 transform (e.g. esriSRGeoTransformation_OSGB1936_To_WGS1984Petrol) to be applied when converting between 27700 and 4326).

Is there an equivalent available in ArcGIS Pro SDK?

Reply
0 Kudos
4 Replies
Highlighted
New Contributor III

Hi Jon,

There is not an equivalent to setting a default transformation. Create a ProjectionTransformation and call GeometryEngine.ProjectEx.

Annette

Reply
0 Kudos
Highlighted
New Contributor

Is it on the roadmap to be added in future? It was an extremely useful feature, especially when there wasn't a call to Project() in our code that could be replaced with ProjectEx().

I have found when using e.g. ProjectionTransformation.Create(sr27700, sr4326) that "OSGB_1936_To_WGS_1984_7" is automatically added as the Transformation (and, when the parameters are swapped, IsForward correctly set to false ). This, actually, should be sufficient for our needs so long as the same Transformation selection will also occur and be applied when e.g. requesting a Raster as BNG from a WebMercator Raster Dataset with, say:

   Raster raster = rasterDataset.CreateFullRaster(); // e.g. from WebMercator dataset

   raster.SetSpatialReference(sr27700);

   Envelope ext = EnvelopeBuilder.CreateEnvelope(400000, 100000, 450000, 150000, sr27700);

   // etc

ProjectionTransformation.CreateFromEnvironment(sr27700, sr4326), however, returns with the Transformation list empty. Also, its documentation page refers to IGeoTransformationOperationSet::Set !

Reply
0 Kudos
Highlighted
New Contributor III

Let me look into this, Jon. I will get back to you.

Annette

Reply
0 Kudos
Highlighted
New Contributor III

Hi Jon, I just want to let you know that I am still looking into this. I should have some more information soon.

Annette

Reply
0 Kudos