ArcGIS Pro 3.7 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 (x,y) location from the surface layer. This method requires a 3D Analyst license. 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.
    x or y cannot be NaN.
    An exception occurred within the InterpolateShape calculation.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    A 3D Analyst license is required.
    Example
    Interpolate Z at an x,y location
    {
      // Note: Needs QueuedTask to run
      // Note: Needs 3d Analyst license to 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 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.4 or higher.
    See Also