ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / GeodeticDensifyByDeviation Method
The geometry to be densified. Cannot be null and its spatial reference cannot be null.
The maximum deviation allowed from the true curve. If maxDeviation is less than or equal to zero, the value of 50 km is used.
The linear unit of maxDeviation.
The type of curve that connects the vertices of the densified geometry.
Example

In This Topic
    GeodeticDensifyByDeviation Method (GeometryEngine)
    In This Topic
    Creates geodetic segments connecting existing vertices and densifies the segments.
    Syntax
    Public Function GeodeticDensifyByDeviation( _
       ByVal geometry As Geometry, _
       ByVal maxDeviation As Double, _
       ByVal deviationUnit As LinearUnit, _
       ByVal curveType As GeodeticCurveType _
    ) As Geometry

    Parameters

    geometry
    The geometry to be densified. Cannot be null and its spatial reference cannot be null.
    maxDeviation
    The maximum deviation allowed from the true curve. If maxDeviation is less than or equal to zero, the value of 50 km is used.
    deviationUnit
    The linear unit of maxDeviation.
    curveType
    The type of curve that connects the vertices of the densified geometry.

    Return Value

    The densified geometry.
    Exceptions
    ExceptionDescription
    Geometry is null or empty. Or geometry's spatial reference is null.
    The method is not implemented for GeometryBag or Multipatch.
    The geomtry is of an incorrect type. (i.e. a point or multipoint).
    Geometry does not have a spatial reference.
    Spatial reference of geometryis an image coordinate system.
    Example
    GeodeticDensifyByDeviation - polyline
    List<Coordinate2D> coords = new List<Coordinate2D>()
    {
      new Coordinate2D(-80, 0),
      new Coordinate2D(-20, 60),
      new Coordinate2D(40, 20),
      new Coordinate2D(0, -20),
      new Coordinate2D(-80, 0)
    };
    
    SpatialReference sr = SpatialReferences.WGS84;
    
    // create a polyline
    Polyline polyline = PolylineBuilderEx.CreatePolyline(coords, sr);
    
    // densify in km
    Polyline geodesicPolyline = GeometryEngine.Instance.GeodeticDensifyByDeviation(polyline, 200, LinearUnit.Kilometers, GeodeticCurveType.Geodesic) as Polyline;
    // densify in m
    geodesicPolyline = GeometryEngine.Instance.GeodeticDensifyByDeviation(polyline, 200, LinearUnit.Meters, GeodeticCurveType.Geodesic) as Polyline;
    
    // Change curve type to Loxodrome
    Polyline loxodromePolyline = GeometryEngine.Instance.GeodeticDensifyByDeviation(polyline, 200, LinearUnit.Meters, GeodeticCurveType.Loxodrome) as Polyline;
    
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also