I am getting two different values from microstations "Export Google Earth File" tool which produces a kml file for the DGN elements and from the DgnGCS.LatLongFromCartesian method.
The KML file contains everything mapped out in the correct lat long.. the LatLongFromCartesian method is giving values off by about 100 meters..
See image: https://imgur.com/a/mkvdtIB
This is not just happening with the ACS coordinates, just using it as an example.
DgnGCS cs = DgnGCS.FromModel(Session.Instance.GetActiveDgnModel(), true); if (cs == null) return; ModelInfo mInfo = Session.Instance.GetActiveDgnModel().GetModelInfo(); double scale = mInfo.UorPerMaster; DPoint3d offset = mInfo.GlobalOrigin; // 0, 0, 0 No global origin. DPoint3d acsOriginUor; ACSManager.GetActive(Session.GetActiveViewport()).GetOrigin(out acsOriginUor); DPoint3d acsOrigin = new DPoint3d((acsOriginUor.X - offset.X) / scale, (acsOriginUor.Y - offset.Y) / scale, (acsOriginUor.Z - offset.Z) / scale); GeoPoint acsLatLng; cs.LatLongFromCartesian(out acsLatLng, acsOrigin); Debug.Print("ACS Lat,Long: " + acsLatLng.Latitude + "," + acsLatLng.Longitude);
Seems fine with US coordinate systems I have tried, but not with this British National Grid.
Am I missing something or is there something wrong with the LatLongFromCartesian method?
Here is the DGN:
certainty3d-my.sharepoint.com/.../ETna477Ka4RAoNSjXsvK2iwBOEgfol-yR6gUH2hFawQ7fQ
Hi Maury,
Arnab Gogoi has asked me about this issue and we are reviewing and investigating it. In the mean time, I did a quick search on Communities and found this response from a Bentley developer that may provide another necessary step/consideration to add to your code. Can you try this recommendation and see if it helps?
Thank you,Bob
Hi Bob, do you know if there has been any progress on this issue?
the issue you had reported was reproducible and the Defect 1090303 was filed with high priority to address this issue and a Service Request filed opened on your behalf. The current status of this Defect is in progress, a fix is not yet available.
Best regards,Artur
Hi Artur,
This issue had popped up again with the Maryland Nad27 coordinate system for one of our current customers so I do hope it is resolved quickly.
Thanks!
Artur Goldsweer
Robert Hook
This is still happening in Update 16.
I am sorry I can confirm that this is not yet fixed and no target release defined.