ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / GetElevationProfileFromSurfaceAsync Method / GetElevationProfileFromSurfaceAsync(IEnumerable<Polyline>) Method
A set of polylines.
Example

In This Topic
    GetElevationProfileFromSurfaceAsync(IEnumerable<Polyline>) Method
    In This Topic
    Gets an elevation profile for the specified polylines. The Z values of the calculated polyline are populated from the Ground Surface Layer.
    Syntax
    public Task<ElevationProfileResult> GetElevationProfileFromSurfaceAsync( 
       IEnumerable<Polyline> polylines
    )
    Public Overloads Function GetElevationProfileFromSurfaceAsync( _
       ByVal polylines As IEnumerable(Of Polyline) _
    ) As Task(Of ElevationProfileResult)

    Parameters

    polylines
    A set of polylines.

    Return Value

    An ElevationProfileResult. If successful, this contains the generated polyline.
    Exceptions
    ExceptionDescription
    polylines cannot be null.
    This Map does not have a visible Ground Surface Layer.
    Remarks
    If the surface has no data at a particular input geometry point, then the corresponding output geometry point Z will be set to the value specified in SurfaceZsMissingHandler.DefaultOutputZ.
    Example
    Get Elevation profile from the default ground surface
    {
      // get the elevation profile for a polyline / set of polylines
      Polyline polyline = PolylineBuilderEx.CreatePolyline();
      MapPoint mapPoint = MapPointBuilderEx.CreateMapPoint(34, -118, SpatialReferences.WGS84);
      List<MapPoint> mapPoints = new List<MapPoint> { mapPoint };
      var result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync([polyline]);
      if (result.Status == SurfaceZsResultStatus.Ok)
      {
        var polylineZ = result.Polyline;
    
        // process the polylineZ
    
        // get the elevation profile for a set of points
        result = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(mapPoints);
        if (result.Status == SurfaceZsResultStatus.Ok)
        {
          polylineZ = result.Polyline;
          // process the polylineZ
        }
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.4 or higher.
    See Also