ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / TinLayer Class / CanInterpolateShape Method
The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.
Example

In This Topic
    CanInterpolateShape Method (TinLayer)
    In This Topic
    Determines if values can be interpolated for the given geometry. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    public bool CanInterpolateShape( 
       Geometry geometry
    )
    Public Function CanInterpolateShape( _
       ByVal geometry As Geometry _
    ) As Boolean

    Parameters

    geometry
    The geometry to be interpolated. It must be a point, multipoint, polyline or polygon.

    Return Value

    True if the shape can be interpolated. False otherwise.True if checks pass. False otherwise.
    Remarks
    It is important to call this method prior to InterpolateShape(Geometry,SurfaceInterpolationMethod) or InterpolateShape(Geometry,SurfaceInterpolationMethod,Double,Double) to ensure that a possible result can be found given the set of input parameters.

    Note that if this method returns true it does not preclude the InterpolateShape method from throwing an exception due to a calculation error and callers should code defensively and use appropriate exception handling.
    Example
    Interpolate Shape
    var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
    await QueuedTask.Run(() =>
    {
      Geometry output = null;
      // interpolate z values for a geometry
      if (tinLayer.CanInterpolateShape(polyline))
        output = tinLayer.InterpolateShape(polyline, SurfaceInterpolationMethod.NaturalNeighbor);
    
      if (output != null)
      {
        // process the output
      }
    
    
      // densify the shape before interpolating
      if (tinLayer.CanInterpolateShape(polygon))
        output = tinLayer.InterpolateShape(polygon, SurfaceInterpolationMethod.Linear, 0.01, 0);
    
      if (output != null)
      {
        // process the output
      }
    
    });
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.4 or higher.
    See Also