I'm using geodesicMovePoints to record locations of marine mammals using a bearing and distance provided by the user.
So far everything is working smoothly using something like this
//create point for platform location
AGSPoint* vesselPoint = [AGSPoint pointWithX:[platX doubleValue] y:[platY doubleValue] spatialReference:[AGSSpatialReference wgs84SpatialReference]];
//drop it in an arrray for move
NSArray *pointArray = [NSArray arrayWithObject:vesselPoint];
//move points
AGSGeometryEngine *pointEngine = [[AGSGeometryEngine alloc]init];
NSArray *movedPoints = [pointEngine geodesicMovePoints:pointArray byDistance:distance inUnit:AGSSRUnitMeter azimuth:bearing];
AGSPoint* updatedPoint = [movedPoints firstObject];
However it doesn't seem like the point are being moved far enough... for instance I have collected a couple test points using a base TPK with some buffered distances baked in from some test points:
The first point was collected with an offset of 10 meters at bearing 180.
The second point was collected with an offset of 50 meters, also at 180.
The actual measurements from the test point are 7.7 and 45.8 meters.
Can someone explain a bit about what is going on in the geodesicMovePoints function? Any ideas what might be accounting for the discrepancy in distance?
Solved! Go to Solution.
Noticed a somewhat related post here:
https://community.esri.com/message/349283#349283
I think what was happening is that the geodesic move may have been executing in Web Mercator. Not sure why, as I was firing up a new geometry engine for the task and explicitly creating a WGS84 point to move.
Either way I changed up some variable types (bearing and distance as double vs. integer) and magically everything started working. Now have a check to do a geodesic measure back between the original point and new point and it checks out every time.
Weird - but whatever.
-Mike
Noticed a somewhat related post here:
https://community.esri.com/message/349283#349283
I think what was happening is that the geodesic move may have been executing in Web Mercator. Not sure why, as I was firing up a new geometry engine for the task and explicitly creating a WGS84 point to move.
Either way I changed up some variable types (bearing and distance as double vs. integer) and magically everything started working. Now have a check to do a geodesic measure back between the original point and new point and it checks out every time.
Weird - but whatever.
-Mike