peter
peter

Reputation: 8682

How to convert a start point and end point in Polyline to WGS84 in arcgis pro sdk

I have a code as shown below and co ordinates are in meter and need to convert to WGS system

    private async void ShowBalloonCallout(Geometry geometry)
    {
        
        if (geometry is Polyline polyline)
        {
            var startPoint = polyline.Points.FirstOrDefault();
            var endPoint = polyline.Points.LastOrDefault();
        }
    }

Upvotes: 0

Views: 73

Answers (1)

peter
peter

Reputation: 8682

I did like this below code

public MapPoint ConvertToWGS84(MapPoint originalPoint)
 {
     var spatialReferenceWGS84 = SpatialReferenceBuilder.CreateSpatialReference(4326);
     MapPoint projectedPoint = (MapPoint)GeometryEngine.Instance.Project(originalPoint, spatialReferenceWGS84);
     return projectedPoint;
 }

Upvotes: 0

Related Questions