ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TinLayer Class / InterpolateShape Method / InterpolateShape(Geometry,SurfaceInterpolationMethod,Double,Double) Method
The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.
The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear./
A densification parameter. If specified, the multipart will be densified by the value prior to interpolating heights from the surface.
A 2D distance filter to prevent oversampled output. If specified, this value ensures that no two consecutive vertices will be closer than this distance. Use 0 to turn off weeding.

In This Topic
    InterpolateShape(Geometry,SurfaceInterpolationMethod,Double,Double) Method
    In This Topic
    Interpolates Z values for a geometric shape from the surface layer. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax

    Parameters

    geometry
    The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.
    interpolationMethod
    The method of interpolation. The default method of interpolation for TINs is SurfaceInterpolationMethod.Linear./
    stepSize
    A densification parameter. If specified, the multipart will be densified by the value prior to interpolating heights from the surface.
    profileWeedTolerance
    A 2D distance filter to prevent oversampled output. If specified, this value ensures that no two consecutive vertices will be closer than this distance. Use 0 to turn off weeding.

    Return Value

    A ArcGIS.Core.Geometry.Geometry with surface elevation z values.
    Exceptions
    ExceptionDescription
    geometry cannot be null.
    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.
    Remarks
    Portions of the input not falling within the interpolation zone of the surface will be clipped.

    Input polylines and polygons are densified by the stepSize. This takes place before interpolating heights from the surface. The densification ensures no two vertices are spaced more than stepSize apart. The stepSize argument isn't very important when the surface is a TIN as the default sampling scheme of using input vertices and triangle edge intersections is sufficient to capture all surface information.

    If the interpolation method is linear and the surface is a TIN, the stepSize argument isn't very important since the default sampling scheme of using input vertices and triangle edge intersections is sufficient to capture all surface information. With linear interpolation that occurs when stepSize is less than or equal to 0 or is set to NaN. The use of stepSize is more relevant when the interpolation method is something other than linear.

    If the interpolation method is natural neighbors, a stepSize less than or equal to 0 outputs input vertices and hard edge crossings only. If stepSize is NaN, the output includes the input vertices and all triangle edge intersections.

    Weeding is most applicable when using linear interpolation. This is because the 'natural densification' used by linear interpolation, the insertion of vertices at triangle edge intersections, can result in very closely spaced vertices at certain locations. To turn off weeding set the profileWeedTolerance to 0.

    InterpolateShape 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.

    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also