ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / RasterLayer Class / InterpolateShape Method / InterpolateShape(Geometry,Double) Method
The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.
A densification parameter. If specified, the multipart will be densified by the value prior to interpolating heights from the raster surface.

In This Topic
    InterpolateShape(Geometry,Double) Method
    In This Topic
    Interpolates Z values for a geometric shape from the raster layer. Bilinear interpolation is used. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public Geometry InterpolateShape( 
       Geometry geometry,
       double stepSize
    )
    Public Overloads Function InterpolateShape( _
       ByVal geometry As Geometry, _
       ByVal stepSize As Double _
    ) As Geometry

    Parameters

    geometry
    The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.
    stepSize
    A densification parameter. If specified, the multipart will be densified by the value prior to interpolating heights from the raster surface.

    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. If specified, this value ensures that no two vertices are spaced more than stepSize apart.

    Specifying stepSize should be considered with a raster. Generally, the smaller the stepSize the greater the detail (unless smaller than 1/2 the raster cellsize), but at an increased cost in processing time and size of resulting geometry. The default stepSize for a raster based surface is set equal to the raster cellsize.

    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