GeodeticMove Method (IGeometryEngine)
Moves each point in the input array by the given distance.
The function returns the number of points that has been moved. Points that are outside of the horizon will be discarded.
Parameters
- points
- The points that are to be moved.
- spatialReference
- The spatial reference of the points.
- distance
- The distance by which the points will be moved.
- distanceUnit
- The unit of the distance property.
- azimuth
- The azimuth angle in radians of the direction for the points.
- curveType
- The type of curve to follow when moving the points.
Return Value
The number of points moved. Points outside of the horizon will be discarded.
Perform Geodetic Move on a set of MapPoints
SpatialReference sr = SpatialReferences.WebMercator;
var points = new[] { MapPointBuilderEx.CreateMapPoint(0, 0, sr) };
double distance = 10;
double azimuth = Math.PI / 2;
var resultPoints = GeometryEngine.Instance.GeodeticMove(points, sr, distance, LinearUnit.Meters, azimuth, GeodeticCurveType.Geodesic);
// resultPoints.First().X = 10
// resultPoints.First().Y = 0
// resultPoints.First().SpatialReference.Wkid = sr.Wkid
// Change LinearUnit to Miles
resultPoints = GeometryEngine.Instance.GeodeticMove(points, sr, distance, LinearUnit.Miles, azimuth, GeodeticCurveType.Geodesic);
// resultPoints.First().X = 16093.44
// resultPoints.First().Y = 0
// Change curve type
resultPoints = GeometryEngine.Instance.GeodeticMove(points, sr, distance, LinearUnit.Miles, azimuth, GeodeticCurveType.Loxodrome);
// resultPoints.First().X = 16093.44
// resultPoints.First().Y = 0
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3 or higher.