Select to view content in your preferred language

CIMDatumTransform serialization to JSON not working properly

772
3
Jump to solution
04-26-2023 02:21 AM
marco_vertigis
New Contributor III

Hi there,

In my current project I try to programatically creating a CIMMapDocument definition using CIMMap.ToJson() method. It seems that the configured Datum and GeoTransformations are not properly serialized. See example below..

 

 

"datumTransforms": [
    {
      "type": "CIMDatumTransform",
      "forward": true
    },
    {
      "type": "CIMDatumTransform",
      "forward": false
    }
 ]

 

 

 

Some Information about the GeoTransformation are completely emitted. The json should look like this:

 

 

"datumTransforms" : [
      {
        "type" : "CIMDatumTransform",
        "forward" : true,
        "geoTransformation" : {
          "geoTransforms" : [
            {
              "wkid" : 15749,
              "latestWkid" : 15929,
              "transformForward" : true,
              "name" : "Belge_1972_To_WGS_1984_3"
            }
          ]
        }
      }
]

 

 

I did a bit of testing and found this. When calling the .ToJson() method on a GeoTransformation object a NotImplementedException is thrown >

 

 

cimMapDefinition.DatumTransforms[0].GeoTransformation.ToJson();

 

 

 

Someone got an idea how a GeoTransformation can be serialized properly?

0 Kudos
1 Solution

Accepted Solutions
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Sorry about that, somebody from Product Development will look at this issue and try to fix the problem with an upcoming 3.2 patch.

View solution in original post

3 Replies
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Sorry about that, somebody from Product Development will look at this issue and try to fix the problem with an upcoming 3.2 patch.

Wolf
by Esri Regular Contributor
Esri Regular Contributor

@marco_vertigis  the developer is not able to duplicate your issue using the following code snippet in an add-in:

 

      return QueuedTask.Run(() =>
      {
        var map = MapView.Active.Map;
        var mapDef = map.GetDefinition();
        var json = mapDef.DatumTransforms[0].GeoTransformation.ToJson();
      });

 

Can you send us a .mapx?  We don’t need the actual data, so it’s OK if the layer connections are all broken.
Maybe the cause is data related.   You can use the 'Esri Communities' messages to keep the mapx confidential.   

Thanks,

Wolf

0 Kudos
marco_vertigis
New Contributor III

I sent you the maps as private message.

0 Kudos