ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TinLayer Class / InterpolateZ Method
The x coordinate.
The y coordinate.
The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear./
Example

In This Topic
    InterpolateZ Method (TinLayer)
    In This Topic
    Interpolates the z coordinate of the specified xy location from the surface layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Function InterpolateZ( _
       ByVal x As Double, _
       ByVal y As Double, _
       ByVal interpolationMethod As SurfaceInterpolationMethod _
    ) As Double

    Parameters

    x
    The x coordinate.
    y
    The y coordinate.
    interpolationMethod
    The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear./

    Return Value

    The surface elevation Z value.
    Exceptions
    ExceptionDescription
    The set of parameters is invalid for this surface. See CanInterpolateShape.
    An exception occurred within the InterpolateShape calculation.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    Example
    Interpolate Z at an x,y location
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    await QueuedTask.Run(() =>
    {
      // interpolate values at the specified x,y location
      double z = tinLayer.InterpolateZ(x, y, SurfaceInterpolationMethod.NaturalNeighborZNearest);
    
      // or use a different interpolation method
      z = tinLayer.InterpolateZ(x, y, SurfaceInterpolationMethod.Linear);
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also