In addition. Create two points by offsetY: 1000
[PHP]
AGSPoint *p1 = [AGSPoint pointWithX:webMercatorX y:webMercatorY spatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS_1984_WEB_MERCATOR_AUXILIARY_SPHERE]];
AGSMutablePoint *p2 = [AGSMutablePoint pointWithX:p1.x y:p1.y spatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS_1984_WEB_MERCATOR_AUXILIARY_SPHERE]];
[p2 offsetByX:0 y:1000];
[/PHP]
Then calculate the distance between p1 and p2:
[PHP]
float len1 = [p1 distanceToPoint:p2];
AGSMutablePolyline *line = [[AGSMutablePolyline alloc] initWithSpatialReference:[AGSSpatialReference spatialReferenceWithWKID:WKID_WGS_1984_WEB_MERCATOR_AUXILIARY_SPHERE]];
[line addPathToPolyline];
[line addPointToPath:p1];
[line addPointToPath:p2];
AGSGeometryEngine *engine = [AGSGeometryEngine defaultGeometryEngine];
float len2 = [engine lengthOfGeometry:line];
float len3 = [engine geodesicLengthOfGeometry:line inUnit:AGSSRUnitMeter];
float len4 = [engine shapePreservingLengthOfGeometry:line inUnit:AGSSRUnitMeter];
[/PHP]
The result is:
len1 = len2 = 1000 meters
len3 = len4 = 776.44727 meters
In fact, the real result should be 776.44727 (I measured it in the outdoors, the latitude of my GPS position is 39.082718274606).
So why offsetY:1000 results 776.44727 ? And how can I get the real 1000 meters offset.