ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Map Class / GetZsFromSurfaceAsync Method / GetZsFromSurfaceAsync(Geometry) Method
the input geometry
Example

In This Topic
    GetZsFromSurfaceAsync(Geometry) Method
    In This Topic
    Obtains a geometry that is similar to the given input geometry, where all Z values are populated from the default Ground Surface Layer.
    Syntax
    public Task<SurfaceZsResult> GetZsFromSurfaceAsync( 
       Geometry geometry
    )
    Public Overloads Function GetZsFromSurfaceAsync( _
       ByVal geometry As Geometry _
    ) As Task(Of SurfaceZsResult)

    Parameters

    geometry
    the input geometry

    Return Value

    a result that contains a status , plus an output geometry only if the status is favorable
    Exceptions
    ExceptionDescription
    the input geometry is null
    this Map does not have a Ground Surface Layer
    this Map does not have a CIM definition
    this Map does not have any surfaces
    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 Z values from a surface
    var geometry = await QueuedTask.Run<Geometry>(() =>
    {
      Geometry mapCentergeometry = MapView.Active.Map.CalculateFullExtent().Center;
      return mapCentergeometry;
    });
    //Pass any Geometry type to GetZsFromSurfaceAsync
    var surfaceZResult = await MapView.Active.Map.GetZsFromSurfaceAsync(geometry);
    return surfaceZResult;
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also