ISurface.InterpolateShape Method (ArcObjects .NET 10.6 SDK)

Interpolates z values for a defined geometric shape.

[Visual Basic .NET]Public Sub InterpolateShape ( _ByValpShapeAsIGeometry, _ByRefppOutShapeAsIGeometry, _ [ByRefpStepSizeAsObject] _)

[C#]publicvoidInterpolateShape (IGeometrypShape,ref IGeometryppOutShape,ref objectpStepSize);

[C++]HRESULT InterpolateShape(IGeometry*pShape,IGeometry**ppOutShape,Variant*pStepSize);

[C++]ParameterspShape[in]pShapeis a parameter of typeIGeometry*ppOutShape[out]ppOutShapeis a parameter of typeIGeometry**pStepSize[in, optional]pStepSizeis a parameter of typeVARIANT*

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

The *Shape* is an input 2D geometry. The method interpolates heights for it from the surface, and outputs the result as 3D geometry into *OutShape*.

The input geometry can be a point, polyline or polygon. Portions of the input not falling within the interpolation zone of the surface will be clipped. A NULL pointer ('Nothing' in VisualBasic) is returned when the input falls entirely off the surface.

If specified, input polylines and polygons will be 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 surface is a raster it becomes more important. Generally, the smaller the interval the greater the detail (unless smaller than 1/2 cellsize), but at an increased cost in processing time and size of resulting geometry. The default *stepSize* for raster based surface is set equal to the 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.

**Notes:**

- On rasters, bilinear interpolation is used.
- If the surface is a raster
*stepSize*should be considered. Generally, the smaller the interval the more detail that gets captured (unless smaller than 1/2 cellsize), but at an increased cost in processing time and size of resulting geometry. The default*stepSize*for raster based surface is set equal to the cellsize. - On TINs the method of interpolation is controlled by ITinSurface3.InterpolationMethod.
- On TINs, if the interpolation meethod is linear,ITinSurface3.ProfileWeedTolerance may be useful in preventing oversampled output.
- On TINs, if the interpolation method is linear, 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*less or equal0 or is set to null. The use of*stepSize*is more relevant when the interpolation method is something other than linear. - On TINs, if the interpolation method is natural neighbors, a
*stepSize*less or equal 0 outputs input vertices and hard edge crossings only. If*stepSize*is null the output includes the input vertices and all triangle edge intersections.

[C#]