ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Editing.COGO Namespace / Traverse Class / CanCalculateCoordinates Method
Example

In This Topic
    CanCalculateCoordinates Method
    In This Topic
    Determines if coordinates can be calculated for the traverse using COGO.
    Syntax
    Public Function CanCalculateCoordinates() As Boolean
    public bool CanCalculateCoordinates()

    Return Value

    True if the coordinates can be calculated.
    Remarks
    The traverse is well defined if the following is true - there must be at least 1 course in the traverse; the first course cannot be defined by a tangent curve or an angle/distance line. In addition in order to calculate coordinates, the traverse should also have a StartPoint defined.

    It is important to call this method prior to CalculateCoordinates to ensure that coordinates can be calculated.

    Example
    Calculating Coordinates
    var startPoint = MapPointBuilderEx.CreateMapPoint(7500500.0, 445900.0, spatialReference);
    travParcel.StartPoint = startPoint;
          
    // The geometry of the features created is affected by the ground to grid correction.
    // This correction is also assigned to the traverse and in the following code the
    // active map's ground to grid correction is used.
    var g2gCorrection = map?.GetDefinition()?.GroundToGridCorrection;
    if (g2gCorrection != null)
    {
      travParcel.UseGroundToGridCorrections = true;
      travParcel.GroundToGridCorrection = g2gCorrection;
    }
    else
      travParcel.UseGroundToGridCorrections = false;
    
    // calculate coordinates 
    if (travParcel.CanCalculateCoordinates())
    {
      var coords = travParcel.CalculateCoordinates();
      var sb = new StringBuilder();
      sb.AppendLine("Calculated Coordinates:");
      foreach (var coord in coords)
      {
        sb.AppendLine($"{coord.X:F2}, {coord.Y:F2}");
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.7 or higher.
    See Also