Calculate distance between two AGSPoints

902
2
Jump to solution
04-23-2018 05:33 AM
MuruganandhamKuppan1
New Contributor III

How can we calculate the distance between two AGSPoints. Previously in runtime SDK 10.x the method `

distanceToPoint` is used,

as    

float len = [agsPoint1 distanceToPoint: agsPoint2];


but i didn't find any related methods in runtime SDK 100.x.

0 Kudos
1 Solution

Accepted Solutions
SuganyaBaskaran1
Esri Contributor

Hello, 

You can use `AGSGeometryEngine`'s 

distanceBetweenGeometry1:geometry2:()

for simple planar distance between two points OR

geodeticDistanceBetweenPoint1:point2:distanceUnit:azimuthUnit:curveType:()

to get the geodetic distance. 

Hope this helps

Suganya

View solution in original post

2 Replies
SuganyaBaskaran1
Esri Contributor

Hello, 

You can use `AGSGeometryEngine`'s 

distanceBetweenGeometry1:geometry2:()

for simple planar distance between two points OR

geodeticDistanceBetweenPoint1:point2:distanceUnit:azimuthUnit:curveType:()

to get the geodetic distance. 

Hope this helps

Suganya

MuruganandhamKuppan1
New Contributor III

Thank you SBaskaran-esristaff‌. Finally used as below:

return [AGSGeometryEngine geodeticDistanceBetweenPoint1:point1 point2:point2 distanceUnit:AGSLinearUnit.meters azimuthUnit:AGSAngularUnit.radians curveType:AGSGeodeticCurveTypeGeodesic].distance;

0 Kudos