SurfaceInterpolationMethod Enumeration
Interpolation method used for elevation calculations. See
TinLayer.InterpolateShape and
TinLayer.GetSurfaceLength.
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
}
});
Interpolate Shape Verticies
var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
await QueuedTask.Run(() =>
{
// interpolate z values at the geometry vertices only
Geometry output = tinLayer.InterpolateShapeVertices(polyline, SurfaceInterpolationMethod.NaturalNeighbor);
if (output != null)
{
// process the output
}
// or use a different interpolation method
output = tinLayer.InterpolateShapeVertices(polyline, SurfaceInterpolationMethod.Linear);
});
Interpolate Z at an x,y location
var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
await QueuedTask.Run(() =>
{
// interpolate values at the specified x,y location
double z = tinLayer.InterpolateZ(x, y, SurfaceInterpolationMethod.NaturalNeighborZNearest);
// or use a different interpolation method
z = tinLayer.InterpolateZ(x, y, SurfaceInterpolationMethod.Linear);
});
Get 3D length of multipart by interpolating heights
var tinLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<TinLayer>().FirstOrDefault();
await QueuedTask.Run(() =>
{
// interpolate heights and calculate the sum of 3D distances between the vertices
double length3d = tinLayer.GetSurfaceLength(polygon, SurfaceInterpolationMethod.NaturalNeighbor);
// or use a different interpolation method
length3d = tinLayer.GetSurfaceLength(polyline, SurfaceInterpolationMethod.NaturalNeighborZNearest);
// densify the shape before interpolating
length3d = tinLayer.GetSurfaceLength(polygon, SurfaceInterpolationMethod.NaturalNeighbor, 0.01, 0);
});
System.Object
System.ValueType
System.Enum
ArcGIS.Desktop.Mapping.SurfaceInterpolationMethod
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.4 or higher.