Using a datum shift in Custom LocationDataSource

381
3
06-13-2023 06:48 AM
JoeHershman
MVP Regular Contributor

Hi,

We have custom LocationDataSource implementations in our app, in addition to using the NmeaLocationData source for connecting various devices for external high accuracy GPS on iOS.  These devices will also provide an app which is used to connect to an RTK server for corrections.

I am trying to understand how one applies a datum shift in these cases.

What I am trying to do in our custom LocationDataSource is basically project my Wgs84 point still using Wgs84 but applying a GeographicTransformation, prior to sending the point to UpdateLocation

var sr = SpatialReferences.Wgs84;

MapPoint mp = new MapPoint(longitude, latitude, sr);

var geoStep = new GeographicTransformationStep(108363);
GeographicTransformation geoTransform = new GeographicTransformation(geoStep);

mp = (MapPoint)GeometryEngine.Project(mp, sr, geoTransform);

 

With the NmeaLocationDataSource I do not know how you would necessary apply the datum shift, until you saved the point.

The problem is we don't seem to be coincident when comparing to Field Maps using the same datum shift.  So I am trying to understand if there is a different way this could be done.  

The offset is consistent, about 3 feet.   We really need the two apps to be the same because a group within the company uses Field Maps and they may come to locate the assets at a later date

Thanks,
-Joe
0 Kudos
3 Replies
DiveshGoyal
Esri Regular Contributor

Have you tried using the OutputSpatialReference and OutputDatumTransformation propeties on the NMEALocationDatasource. These will project the location coming out of the datasource

https://developers.arcgis.com/net/api-reference/api/netfx/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Loca...

JoeHershman
MVP Regular Contributor

@DiveshGoyal  Thanks, I had not noticed that.  It looks like the way this is implemented is all in the core libraries.  It would b great to understand what is done so it could be implemented in our own LocationDataSource that cannot use the NMEALocationDataSource

Thanks,
-Joe
0 Kudos
DiveshGoyal
Esri Regular Contributor

It's basically doing what your code is trying to do but I think you may have a typo.

The Geographic Datum Transformation you're using (WKID 108363) seems to convert from WGS_1984_(ITRF08)_To_NAD_1983_2011 based on this doc - http://downloads2.esri.com/support/TechArticles/geographic_transformations_1031.pdf

So the output spatial reference you pass to GeometryEngine.Project()  needs to be GCS_NAD_1983_2011 (not WGS84). So you should create a spatial refeerence with WKID 6318 (taken from this doc - https://pro.arcgis.com/en/pro-app/latest/help/mapping/properties/pdf/geographic_coordinate_systems.p...)

0 Kudos