GetElevationProfileFromSurfaceAsync(IEnumerable<Polyline>,ElevationSurfaceLayer) Method
Gets an elevation profile for the specified polylines.
All Z values of the calculated polyline are populated from the specified Elevation Surface Layer.
Parameters
- polylines
- A set of polylines.
- surfaceLayer
- Identifies the surface to be used. If null is specified, then the default Ground Surface will be used.
Return Value
An
ElevationProfileResult. If successful, this contains the generated polyline.
Get Elevation profile from a specific surface
// find the elevation profile for a polyline / set of polylines
var eleLayer = MapView.Active.Map.GetElevationSurfaceLayers().FirstOrDefault(l => l.Name == "TIN");
var zResult = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync([lineGeom], eleLayer);
if (zResult.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = zResult.Polyline;
// process the polylineZ
}
// find the elevation profile for a set of points
zResult = await MapView.Active.Map.GetElevationProfileFromSurfaceAsync(pts, eleLayer);
if (zResult.Status == SurfaceZsResultStatus.Ok)
{
var polylineZ = zResult.Polyline;
// process the polylineZ
}
Target Platforms: Windows 11, Windows 10
ArcGIS Pro version: 3.4 or higher.