ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TerrainLayer Class / InterpolateShapeVertices Method
The multipart to be interpolated. It must be a polyline or polygon. Use InterpolateZ.to obtain a Z value for a point.
The method of interpolation. The default method of interpolation for Terrain layers is SurfaceInterpolationMethod.Linear.
The z-tolerance or window-size resolution of the terrain pyramid level that will be used. Default value is 0.
Example

In This Topic
    InterpolateShapeVertices Method (TerrainLayer)
    In This Topic
    Interpolates Z values for a geometric shape from the surface layer at it's vertices only. This method requires a 3D Analyst license. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    multipart
    The multipart to be interpolated. It must be a polyline or polygon. Use InterpolateZ.to obtain a Z value for a point.
    interpolationMethod
    The method of interpolation. The default method of interpolation for Terrain layers is SurfaceInterpolationMethod.Linear.
    pyramidResolution
    The z-tolerance or window-size resolution of the terrain pyramid level that will be used. Default value is 0.

    Return Value

    A ArcGIS.Core.Geometry.Geometry with surface elevation z values.
    Exceptions
    ExceptionDescription
    multipart cannot be null.
    multipart cannot be empty.
    pyramidResolution must be 0 or larger.
    An exception occurred within the InterpolateShapeVertices calculation.
    This method or property must be called within the lambda passed to QueuedTask.Run.
    A 3D Analyst license is required.
    Remarks
    A null geometry is returned if any portion of the input falls outside the surface.

    InterpolateShapeVertices will handle differences in spatial reference between the input shape and the surface. It will project (a copy of) the input geometry to match the surface for the sake of interpolation. It will then re-project the output geometry so it's the same as the input shape.

    Example
    Interpolate Shape vertices
    {
      // Note: Needs QueuedTask to run
      // Note: Needs 3d Analyst license to run
      {
        // interpolate z values at the geometry vertices only
        Geometry output = terrainLayer.InterpolateShapeVertices(polyline, SurfaceInterpolationMethod.NaturalNeighbor, 0);
        if (output != null)
        {
          // process the output
        }
    
        // or use a different interpolation method
        output = terrainLayer.InterpolateShapeVertices(polyline, SurfaceInterpolationMethod.Linear, 0);
      }
    }
    Requirements

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

    ArcGIS Pro version: 3.7 or higher.
    See Also